Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Selecting diferent ranges

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    I need help on a macro that selects and copies a range of cells that go from A3 to H?? (the final row depends on the number of entries)

    I have the reference to the H?? cell in "K7" , but I can't make a macro to reference that address, I'm only getting the K7 reference. How do I make the macro select the address that I have in K7? Is it possible or do I have to approach the problem from another angle?

    Thanks,
    Nelson

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Stockton, California
    Posts
    281
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Define k7 as a variable in your macro like this:

    Sub select_range()
    selectend = Range("K7").Value
    Range("A3:" & selectend).Select
    End Sub


    [ This Message was edited by: robfo0 on 2002-04-08 16:54 ]

  3. #3
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just wondering why you place the last row into K7? How about eliminating that step and using the line of code such as
    Range([A3], [H65536].End(xlUp)).Select

    Unless there's something else going on with your spreadsheet, this might be a way to go.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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