Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Use END to select range with data with a Macro?

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a range with data in range A1:H20. I am trying to make a macro which will select this range which may have rows added to it, but never columns added to it. (i.e, itíll always start with A1 and end with column H, but the last row may changes).

    Is there a way to write a marco to do this? And then once itís selected that range, I want to be able to Copy it or Make it the Print Area.

    THANKS!

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-06 14:05, Cosmos75 wrote:
    I have a range with data in range A1:H20. I am trying to make a macro which will select this range which may have rows added to it, but never columns added to it. (i.e, itíll always start with A1 and end with column H, but the last row may changes).

    Is there a way to write a marco to do this? And then once itís selected that range, I want to be able to Copy it or Make it the Print Area.

    THANKS!
    This will copy the range:

    Range("A1", Range("H65536").End(xlUp).Address).Copy

    You'll just have to put in where you want to paste it. You can use variations of that to select and/or set print area.

    Hope this helps,

    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

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
  •