Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,420
    Thanks
    124
    Thanked 5 Times in 5 Posts

    Macro to retain data

    I have a spreadsheet that contains the word "cost" in the text in Col C for eg GENERATOR AT COST.I would like a macro that will retain the row where the word "cost" that appears in the text as well as 2 rows below this, starting from row 8 onwards. The only exception to this is the all dates that appear in Col C must be retainedYour assistance in this regard will be most appreciated
    Attached Files Attached Files
    Last edited by HowardC; 2011-05-09 at 11:35.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    If the example file you posted at http://windowssecrets.com/forums/sho...l=1#post801166 represents what you want, then I am confused by your description. Why is row 17 deleted it meets that criterion that "all dates that appear in Col C must be retained". Also by what criterion are the rows 41-44 retained. They are not dates, they do not have "Cost" in them, nor are they 1 or 2 rows below a row with Cost in them.

    Perhaps you need to rethink your criterion...

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •