+ Reply to Thread
Results 1 to 5 of 5

Macro to delete rows when columns F *or* G don't contain certian data

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Macro to delete rows when columns F *or* G don't contain certian data

    1) Thank you for even looking at this. I am brand spanking new at doing this, and I'm enjoying making macros, but I know very little.

    2) Okay, I've got a spreadsheet where there are two columns, one labeled "Source" and one labeled "Destination." These are columns F and G, respectively. I only want to see items where either Source=Florida **or** Destination=Florida.

    3) I know how to hide and delete all rows where Source=Florida for instance, but of course, that hides and deletes things where Destination=Florida.

    3) So, of course, with the knowledge I have, I can only create a spreadsheet where both the Source AND the Destination=Florida, but that almost never happens. I need some sort of "Or" operator here.

    4) Just to be clear, if the word "Florida" occurs in either column F **or** in column G, I need to keep it, but anything that has any other source or destination, I don't need.

    Am I making sense? I hope I am b/c I have been working on this for hours and I'm not sure I understand myself anymore!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to delete rows when columns F *or* G don't contain certian data

    This hides the rows if column F=Forida, then hides the remaining rows if column G=Florida (OR), then deletes the remaining visible rows and unhides the Florida rows.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro to delete rows when columns F *or* G don't contain certian data

    That left me with a blank spreadsheet?

    I think it is deleting stuff where F may not be "Florida" but G is.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to delete rows when columns F *or* G don't contain certian data

    Do you have data in columns A:E ? Field numbering (columns) starts at the first column with data.

    Is exactly "Florida" in column F and G? No leading or trailing extra characters?

  5. #5
    Registered User
    Join Date
    05-13-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro to delete rows when columns F *or* G don't contain certian data

    My fault!

    This is why I shouldn't mess with macros late at night. In the fresh light of day... it works PERFECTLY! Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1