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!
|