ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copy / paste values for certain range (https://www.excelbanter.com/excel-programming/276325-copy-paste-values-certain-range.html)

Eric Dreshfield

copy / paste values for certain range
 
I am trying to get a macro to work that will take what is
in cell D2 and copy it (as paste-special values) into the
rest of column D provided there is data in column E. In
other words, if the data in column E gos down to row 227 I
would like the value in D2 to be in D3 through D227 as
well. The only catch is the number of rows will vary each
time the macro gets run. I can not use the autofill since
that increments the value of D2 once for each row it
pastes to. Any ideas ?

Thanks !

Don Guillett[_4_]

copy / paste values for certain range
 
try this:

Sub fillDifE()
x = Range("e" & Rows.Count).End(xlUp).Row
Range("d2:d" & x).FillDown
End Sub


"Eric Dreshfield" wrote in message
...
I am trying to get a macro to work that will take what is
in cell D2 and copy it (as paste-special values) into the
rest of column D provided there is data in column E. In
other words, if the data in column E gos down to row 227 I
would like the value in D2 to be in D3 through D227 as
well. The only catch is the number of rows will vary each
time the macro gets run. I can not use the autofill since
that increments the value of D2 once for each row it
pastes to. Any ideas ?

Thanks !




Don Guillett[_4_]

copy / paste values for certain range
 
Thought it would. Glad to help.

"Eric Dreshfield" wrote in message
...
Don,

Thanks...that works like I had hoped ! I appreciate your
help !!

Eric
-----Original Message-----
try this:

Sub fillDifE()
x = Range("e" & Rows.Count).End(xlUp).Row
Range("d2:d" & x).FillDown
End Sub


"Eric Dreshfield" wrote in message
...
I am trying to get a macro to work that will take what

is
in cell D2 and copy it (as paste-special values) into

the
rest of column D provided there is data in column E. In
other words, if the data in column E gos down to row

227 I
would like the value in D2 to be in D3 through D227 as
well. The only catch is the number of rows will vary

each
time the macro gets run. I can not use the autofill

since
that increments the value of D2 once for each row it
pastes to. Any ideas ?

Thanks !



.





All times are GMT +1. The time now is 08:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com