PDA

View Full Version : How to copy from Column A2 to the last populated Column.



bananatang
07-29-2009, 07:46 AM
Hi,

I need some help to create a macro that will copy a range of populated cells.

The 1st cell will be A2 and the number of rows and columns will be dynamic (will change with each report). The macro will need to find the last row and column.

Thanks

BT

mdmackillop
07-29-2009, 09:50 AM
Sub CopyAll()
Dim Rw As Long, Col As Long
Rw = Cells.Find("*", [a1], , , xlByRows, xlPrevious).Row
Col = Cells.Find("*", [a1], , , xlByColumns, xlPrevious).Column
Range(Cells(2, 1), Cells(Rw, Col)).Copy
End Sub