Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi - I would like to Copy/Paste an area dependant on how many rows there are
on a spreadsheet. I was thinking of using something like the below: X = COUNT("D:D") Range("A1:A" & X).Select Selection.Copy Range("D1:D" & X).Select ActiveSheet.Paste Range("E4:E" & X).Select Setting X as the COUNT of Column D, then adding '&' X to the Range to set the length of the Copy/Paste. I haven't gotten it to work. Any advice? Thanks! |
#2
![]() |
|||
|
|||
![]()
X = Application.COUNT("D:D")
you might want COUNTA if there is text in the column -- HTH RP (remove nothere from the email address if mailing direct) "DKehl" wrote in message ... Hi - I would like to Copy/Paste an area dependant on how many rows there are on a spreadsheet. I was thinking of using something like the below: X = COUNT("D:D") Range("A1:A" & X).Select Selection.Copy Range("D1:D" & X).Select ActiveSheet.Paste Range("E4:E" & X).Select Setting X as the COUNT of Column D, then adding '&' X to the Range to set the length of the Copy/Paste. I haven't gotten it to work. Any advice? Thanks! |
#3
![]() |
|||
|
|||
![]()
What hasn't worked?
One alternative: Range("A1:A" & Range("D" & Rows.Count).End(xlUp).Row).Copy _ Destination:=Range("D1") Note that no selections are needed. In article , "DKehl" wrote: Hi - I would like to Copy/Paste an area dependant on how many rows there are on a spreadsheet. I was thinking of using something like the below: X = COUNT("D:D") Range("A1:A" & X).Select Selection.Copy Range("D1:D" & X).Select ActiveSheet.Paste Range("E4:E" & X).Select Setting X as the COUNT of Column D, then adding '&' X to the Range to set the length of the Copy/Paste. I haven't gotten it to work. Any advice? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
I Visual Basic Error "File Not Found" when Excel opens | Excel Discussion (Misc queries) | |||
quattro pro converter Excel 2003 | New Users to Excel | |||
Visual Basic Code Remains in "memory" | Excel Worksheet Functions | |||
Excel 2003 Database Driver Visual FoxPro 7 on Server 2003. | Excel Discussion (Misc queries) |