1

For some reason, the range only copies over the first two rows starting in A1 on sheet "11937" and I need it to start on cell A2 and copy all data up until column AL and paste that data in sheet "STS" starting at C2.

Please help

With Sheets("11937")
.Range("A2:AL" & Cells(Rows.Count, "B").End(xlUp).Row).CopyDestination:=Sheets("STS").Range("C2")
End With
Community
  • 1
  • 1
JHags
  • 11
  • 3

1 Answers1

1

Either your Col B is empty or Cells(Rows.Count, "B") is referring to the Activesheet which may not be 11937. Hence it is always advisable to fully qualify your objects.

Here is an example

Dim lRow As Long

With Sheets("11937")
    lRow = .Range("B" & .Rows.Count).End(xlUp).Row

    .Range("A2:AL" & lRow).Copy Destination:=Sheets("STS").Range("C2")
End With
Siddharth Rout
  • 147,039
  • 17
  • 206
  • 250