Hello, I need a little help here figuring out how to copy and paste values from 3 columns to the next available blank row.
I'm using the macro below right now to fill in Column A. But instead of doing one column at a time, I'd like to be able to have this same code work for columns A through C.
So in column A, it would copy the first value it sees and pastes it until it finds another value in the same column. Same for B and C, all working simultaneously.
Also if possible, I'd like it to have a message box to ask me what cell to start with. The code below starts in A9, but the data I need to copy doesn't always start in A9, sometimes it could be A3. I typically change this manually depending on the spreadsheet I'm using.
Thanks in advance for your help!
Liz
Sub FillRowA()
Dim Name As String
For Each C In Range("A9:A" & Cells(Rows.count, 1).End(xlUp).Row)
If Cells(C.Row, 1) > "" Then
Name = Cells(C.Row, 1).Value
Cells(C.Row, 1).Copy
Else
Cells(C.Row, 1).Value = Name
Cells(C.Row, 1).pastespecial (xlPasteFormats)
End If
Next
End Sub
Note: Example in the attachment. Starting with column A: A3 would be copied and pasted on A4:A7, then A8 would be copied and pasted in A9:A298
Bookmarks