[RESOLVED] Enter a value and copy / paste it to all cells in a column where column A has a value
Hi
I need to copy a cell value down into all cells in a column where there is a value in column A. So if I enter 'Yes' in cell C2 and there are values in A2 to A300 then I want 'Yes' to be copied from C2 to C300. Could be that the next time I run the code there are 5000 values so I can't hardcode the range to copy down to.
Thanks for any suggestions.
Re: Enter a value and copy / paste it to all cells in a column where column A has a v
This code will find the last filled cell in column A and then copy any cells in A to C (note: doesn't address "entering YES in C2"):
Code:
Sub copyAllWithValsInA()
Dim lastRow As Long
Dim i As Long
lastRow = Range("a" & Rows.Count).End(xlUp).Row
For i = 2 To lastRow
If Range("a" & i).Value <> "" Then
Range("c" & i).Value = Range("a" & i).Value
End If
Next i
End Sub