+ Reply to Thread
Results 1 to 7 of 7

VB code to select all rows with data in a column

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    Devon
    MS-Off Ver
    2002
    Posts
    71

    VB code to select all rows with data in a column

    Hi lovely Excel people

    I hope someone can help with this. In my macro, I need code that will select all the rows that contain data in a given column, minus the first row which has a header.

    Hope you can help!

    Helen
    Last edited by HelenW; 12-05-2008 at 07:11 AM.

  2. #2
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180
    Hi,

    Please Login or Register  to view this content.
    HTH
    Kris

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Helen,

    When you say all rows that contain data, does that mean there could be blank rows mixed in with the non-blank rows also?

    Sincerely,
    Leith Ross

  4. #4
    Registered User
    Join Date
    09-18-2008
    Location
    Devon
    MS-Off Ver
    2002
    Posts
    71
    Hi Leith - no, there will be no blanks, but I only want to select as far down as the data goes. There will be a different number of rows each time I run the macro.

    Krish's code is great, but I took off the bit about the message box (not needed as the macro will then carry on and do other stuff) and it didn't show as selecting anything!

    Thanks for your help.

  5. #5
    Registered User
    Join Date
    09-18-2008
    Location
    Devon
    MS-Off Ver
    2002
    Posts
    71
    Just wanted to bump this one back up in case anyone can help!

  6. #6
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180
    Hi,

    What do you want after getting the range?

  7. #7
    Registered User
    Join Date
    09-18-2008
    Location
    Devon
    MS-Off Ver
    2002
    Posts
    71
    It's ok - will mark as solved as I figured out what I wanted to do. Thanks!

+ 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