G
Guest
ok, im very new, so im learning as i go, i keep getting error "Subscript out
of range"
when i use this, if i watch the sheets, it starts to do what it is supposed
to do, then i get the error..
could someone please help me
---
Sub CopyToSheets()
Dim rng As Range
Dim oCell As Range
Set rng = Range("B4:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each oCell In rng
oCell.EntireRow.Copy _
Destination:=Sheets(oCell.Value).Range("A65536").End(xlUp).Offset(1,
0)
Next oCell
End Sub
of range"
when i use this, if i watch the sheets, it starts to do what it is supposed
to do, then i get the error..
could someone please help me
---
Sub CopyToSheets()
Dim rng As Range
Dim oCell As Range
Set rng = Range("B4:B" & Cells(Rows.Count, "B").End(xlUp).Row)
For Each oCell In rng
oCell.EntireRow.Copy _
Destination:=Sheets(oCell.Value).Range("A65536").End(xlUp).Offset(1,
0)
Next oCell
End Sub