I have a code where I'm receiving a "'Range' of Object _Global' failed" error and I'm hoping someone can help as to why. I've looked online and everything seems to advise that I need to specific which sheet the code is referring to, which i've done using With and End With. Please see my code below;
However, it doesn't seem to be working. The variables specified above this code are as follows;
Dim ws7 As Worksheet
Set ws7 = ActiveSheet
Dim StartingPoint As Range
Dim EndPoint As Range
Set StartingPoint = Sheets("Tables").Range("C58:R58").Find(ws7.Range("C3"))
If Not StartingPoint Is Nothing Then
Set EndPoint = StartingPoint.Offset(10, 0)
Any help and / or useful reading material would be much appreciated.
With statement is not currently doing anything as you haven't qualified the
Range call - it needs to be:
With ThisWorkbook.Worksheets("Tables") .Range(StartingPoint, EndPoint).Copy End With
Note the full stop in
Also, this assumes those two ranges are on the Tables sheet, or the code will fail.