![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
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 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Wildpitch
Try this Code:
Sheet1.Range("B1", Sheet1.Range("B65536").End(xlUp)).Copy Destination:= _
Sheet2.Range("A1")
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
Fantastic, thanks very much Dave. Much easier than I had thought.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|