Aug 08 2022 05:52 AM
A worksheet is populated with data in specified columns, but each time the number of populated rows is different. I need a macro to identify and copy the data from the varying ranges that can exist.
Thank you for any suggestions you may have.
Aug 08 2022 06:07 AM
SolutionSub copy()
Dim MaxRow As Long
Range("D:D").Clear
MaxRow = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:A" & MaxRow).copy Destination:=Cells(1, 4)
End Sub
You can try this macro to indentify the range in column A and to copy the content to column D.
Aug 08 2022 09:10 AM
Thank you...that helps a lot.
Aug 08 2022 10:04 AM
Aug 08 2022 06:07 AM
SolutionSub copy()
Dim MaxRow As Long
Range("D:D").Clear
MaxRow = Range("A" & Rows.Count).End(xlUp).Row
Range("A1:A" & MaxRow).copy Destination:=Cells(1, 4)
End Sub
You can try this macro to indentify the range in column A and to copy the content to column D.