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

Thread: Select range

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

    Default

     
    Help, please.
    I've got a VB app that dumps two columns of text into an spreadsheet for formatting and tidying, before being copied back out to another app. Where I'm stuck is that it's a random ammount of text, ranging from 1 row up to 30, and always 2 columns. Everything works a treat whilst I have defined a range to select in the Excel macro. What I want to do is make the select range dynamic, so that if only 5 rows contain data, the macro only copies 5 rows. Anyone able to help please?

    Thanks

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Wildpitch

    Try this


    Code:
    Sheet1.Range("B1", Sheet1.Range("B65536").End(xlUp)).Copy Destination:= _
    Sheet2.Range("A1")
    Just change references to suit.


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

    Default

      
    Fantastic, thanks very much Dave. Much easier than I had thought.

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
  •  

 

 
DMCA.com