LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Testing for named cells (i.e., ranges)

The following code is written to test for the existence of a cell named
"anchor" on the Active Sheet but it does not work. If the named cell exists,
that named range is supposed to become the active cell.

Something is wrong with the second statement. Even if a cell named "anchor"
exists on the active sheet, the resulting CellName is Nothing. Why?

Dim CellName as Name

On Error Resume Next
Set CellName = ActiveSheet.Names("anchor").Name
On Error GoTo 0
If Not CellName Is Nothing Then
Application.Goto Reference:=CellName
Else
Application.Goto Reference:=Range("A1")
End If

Thank you.

John Wirt


 
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
Testing selection against named range [email protected][_2_] Excel Discussion (Misc queries) 5 April 17th 12 04:19 PM
Named Cells (Ranges) Derek Hart Excel Discussion (Misc queries) 4 November 3rd 08 07:59 AM
Replace a spreadsheets named cells/ranges with exact cell address. David McRitchie Excel Discussion (Misc queries) 0 September 28th 05 08:59 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 04:49 AM.

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

About Us

"It's about Microsoft Excel"