I'm trying to copy cell values from the next sheet to the currently active sheet but the 'if' condition throws the following error.
Any idea what I'm missing or how to define the variable to eliminate the error?
Perhaps there is a better way to do this, any help would be appreciated.
Run-time error 91
Object or with block variable not set
If ActiveSheet.Next.Range("B2") = "Name:" Then
ActiveSheet.Cells(2, 3) = ActiveSheet.Next.Range("C2")
ActiveSheet.Cells(3, 3) = ActiveSheet.Next.Range("C3")
ActiveSheet.Cells(4, 3) = ActiveSheet.Next.Range("C4")
ActiveSheet.Cells(5, 3) = ActiveSheet.Next.Range("C5")
ActiveSheet.Cells(5, 6) = ActiveSheet.Next.Range("F5")
End If
Bookmarks