Object Required - Excel VBA

Hi

When I try to ask the attached code, it ask for object required.  Can someone explain why, and how to fix it.

Sub Test2()
Dim NewDestination As Long
Range("A:D").SpecialCells(xlCellTypeConstants, xlNumbers).Copy Range("I1")
Set NewDestination = Range("I1")
For Each Rng In Cells.SpecialCells(xlCellTypeConstants, xlNumbers).Areas
    Rng.Copy Destination:=NewDestinations
    Set NewDestination = NewDesttination.Offset(Rng.Rows.Count)
Next Rng
End Sub

Thanks

Greg
greg_cAsked:
Who is Participating?
 
MacroShadowConnect With a Mentor Commented:
Change Set NewDestination = Range("I1") to NewDestination = Range("I1").
The set keyword is for objects.
0
 
greg_cAuthor Commented:
Thank you
0
All Courses

From novice to tech pro — start learning today.