+ Reply to Thread
Results 1 to 5 of 5

Is it possible to a macro go row by row and hide (or delete) and rows where column 1 is ""

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    48

    Is it possible to a macro go row by row and hide (or delete) and rows where column 1 is ""

    The title says it all, can throw together a sample sheet if needed but its basically a sheet that I get from my acct program that always has excess lines, and the lines I need always have a code in column 1 so I want to set up a macro to go line by line and hide or delete lines with blanks in 1.

    Something like a looping macro which I have a little exp with.

    thoughts??

    Thanks in advance.

    ~James
    Last edited by CDNcameron; 06-20-2013 at 01:33 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Is it possible to a macro go row by row and hide (or delete) and rows where column 1 i

    If there is a code for the lines you want to keep, you could use Autofilter to either display them or hide them. If you choose to hide them, you could then select and delete the visible rows, and then clear the filter.

    That would be a lot quicker than looping through the rows and hiding or deleting them.

    Record a macro while you do it. It will probably need to be tweaked but it will give you the basics.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Is it possible to a macro go row by row and hide (or delete) and rows where column 1 i

    Thanks for the rep.

  4. #4
    Registered User
    Join Date
    03-06-2012
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Is it possible to a macro go row by row and hide (or delete) and rows where column 1 i

    My pleasure, can't believe that didn't occur to me, did that while cleaning up a file for someone just this week!

    Mind never works when we want it to.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,293

    Re: Is it possible to a macro go row by row and hide (or delete) and rows where column 1 i

    Way it goes. Sometimes, when you describe a problem to someone else, you see the solution yourself. Sometimes you don't.

    But the forum is a good way of bouncing ideas ... even if sometimes you wish you hadn't asked

    Regards, TMS

+ 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