Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Dec 25, 12:42*am, JE McGimpsey wrote:
One way: * * Dim rTest As Range * * On Error Resume Next * * Set rTest = ActiveWorkbook.Names( _ * * * * * * "AccountAbbreviations").RefersToRange * * On Error GoTo 0 * * IfNotrTest Is Nothing Then rTest.ClearContents * *In article , *cellist wrote: I get "Run-time error 1004,Referenceisnotvalid" when I execute Application.GotoReference:="AccountAbbreviations" * * Selection.ClearContents The name "AccountAbbreviations" is, in fact,notdefined. How can I check fornotdefined so that the code can continue? TIA, Phil- Hide quoted text - - Show quoted text - thanks JE |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try
Application.Goto Range("AccountAbbreviations"),True Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Wed, 24 Dec 2008 21:06:00 -0800, 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 |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Dec 25, 9:04*am, Chip Pearson wrote:
Try Application.Goto Range("AccountAbbreviations"),True Cordially, Chip Pearson Microsoft MVP * *ExcelProduct Group Pearson Software Consulting, LLCwww.cpearson.com (email on web site) On Wed, 24 Dec 2008 21:06:00 -0800, cellist wrote: I get "Run-time error 1004,Referenceisnotvalid" when I execute Application.GotoReference:="AccountAbbreviation s" * *Selection.ClearContents The name "AccountAbbreviations" is, in fact,notdefined. How can I check fornotdefined so that the code can continue? TIA, Phil- Hide quoted text - - Show quoted text - thanks Chip. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error GoTo Doesn't Work | Excel Discussion (Misc queries) | |||
I got this problem run-time error 1004 application defined ... | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |