Consulting

Results 1 to 5 of 5

Thread: How to select changing cells within a column

  1. #1

    How to select changing cells within a column

    Hi, I basically need help selecting a column from a range that has a changing number of cells.

    For example, if cells 5 through 20 are filled in column a. I need a macro that will select those cells so I can copy them to another sheet. The problem is that the next time it could be cells 5-24 filled etc. I know the range will always start at cell A-16 but the end can change.

    I hope that explanation was clear enough...Thanks for your help in advance!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Range("A16").End(xlDown).Select
    [/vba]

    but there is unlikely to be a reason to need to select a cell.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    thanks for the response, but what if I want to select all the data between A16 and the end of the range? (the cell selected after applying your code "Range("A16").End(xlDown).Select ")

    Thanks!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Range(Range("A16"),Range("A16").End(xlDown)).Select
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    super, thanks!!

Posting Permissions

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