Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Application.Goto Reference gets error 1004

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   Report Post  
Posted to microsoft.public.excel.misc
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Application.Goto Reference gets error 1004

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Application.Goto Reference gets error 1004

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
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Application.Goto Reference gets error 1004

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On Error GoTo Doesn't Work [email protected] Excel Discussion (Misc queries) 2 November 29th 07 09:43 PM
I got this problem run-time error 1004 application defined ... Davide Blau Excel Discussion (Misc queries) 2 July 10th 06 09:27 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"