Hi
Im trying to create a macro to copy cells K1 to AE1 to every row that has data in column A. Once it finds an empty cell in column A i want the macro to stop
help please
Mark
Printable View
Hi
Im trying to create a macro to copy cells K1 to AE1 to every row that has data in column A. Once it finds an empty cell in column A i want the macro to stop
help please
Mark
Hunh?
:dunno what you mean.
i want to select cells K1 through to AE1 and then copy them down through every row that has data in column A.
For example if A1 through to A? has data i want to copy the cells in ranke k1:Ae1 through to K?:AE?
the problem i have is that the data changes and the amount of rows with data in column A can change (increase)
.Cells(r, "A") is the same as .Range("A" & r)Code:Sub CopyAndPaste_KAE()
Dim rngKAE as Range
Dim r as Long
With Sheets("Sheet1") 'Edit to suit
Set rngKAE = .Range("K1:AE1")
For r = 2 to .Cells(Rows.Count, "A").End(xlUp).Row
If .Cells(r, "A") = "" Then .Range("K" & r & ":AE" & r) = rngKAE
Next r
End With
End Sub