View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Application.Goto Reference gets error 1004

One way:

Dim rTest As Range
On Error Resume Next
Set rTest = ActiveWorkbook.Names( _
"AccountAbbreviations").RefersToRange
On Error GoTo 0
If Not rTest Is Nothing Then rTest.ClearContents



In article ,
cellist wrote:

I get "Run-time error 1004, Reference is not valid" when I execute
Application.Goto Reference:="AccountAbbreviations"
Selection.ClearContents
The name "AccountAbbreviations" is, in fact, not defined. How can I check
for not defined so that the code can continue?

TIA,

Phil