Within VBA, I wish to goto a named range. But I don't know if the named range exists in this particular file and I don't know what tab it may be on. So I thought I could do this:
But this will not take me to "PointA" even if it exists if I am not on the sheet that PointA exists on. It works interactively in Excel but not with VBA. So how can I go to PointA if it exits using VBA? Thanks. And my PointA and PointB ranges are in the Scope Workbook.
Code:
On Error GoTo SkipCopyC
Range("PointA").Select
Selection.Copy
Application.Goto Reference:="PointB"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
:SkipCopyC
But this will not take me to "PointA" even if it exists if I am not on the sheet that PointA exists on. It works interactively in Excel but not with VBA. So how can I go to PointA if it exits using VBA? Thanks. And my PointA and PointB ranges are in the Scope Workbook.