Macro to copy a range

  • Thread starter Thread starter jamesa
  • Start date Start date
J

jamesa

I want to copy a range on a ws from A2 to H.. where the
text entry in colum H ends. Please help.

Regards
JA
 
Hi jamesa,

Try this

Sub CopyMyRange()

Dim r As Integer
r = 2
Do While Cells(r, 7) <> ""
r = r + 1
Loop
Range(Cells(2, 1), Cells(r - 1, 7)).Copy

End Sub
 
Here is one possible interpretation of what you are asking:

Dim rng as Range
set rng = cells(rows.count,"H").end(xlup)
Range(Range("A2"),rng).copy destination:=Range("M2")
 
Back
Top