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: 30
Default Testing to see if a specific name has been already assigned to cellor range.

I want a macro to be able to reassign the cell location associated with
a “name”. I believe to do so requires three steps:

(1) Test to see if name has already been assigned, and if so,
(2) DELETE.
(3) Assign the name to the current active cell.

PROBLEM AREA - It would seem to me that the test would use code such as:
If[ActiveWorkbook.Names("Priority").Value 0] then ….
BUT I KNOW THIS CODE IS NOT RIGHT.

If it is already in use, the name can be removed by the code:
ActiveWorkbook.Names("Priority").Delete

The name can then be added back using something like:
ActiveWorkbook.Names.Add Name:="TheData", RefersTo:="=Sheet1![A1,E10]"
Or alternatively
Range("A1:E10").Name = "Priority"
Or possibly
ActiveWorkbook.ActiveSheet.ActiveCell.Name = "Priority"

SUGGESTIONS WOULD BE APPRECIATED for the proper syntax to test for a
specific name having been already assigned to a cell or region.
 
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
Access to a series, when it is assigned to an empty range Werner Rohrmoser Excel Worksheet Functions 0 March 17th 10 06:48 PM
TESTING A RANGE OF CELLS Richard[_2_] New Users to Excel 3 April 1st 07 02:52 PM
Testing a person's age to be within a range MH Excel Worksheet Functions 10 December 31st 06 10:04 PM
Assigned specific decimal space James[_35_] Excel Programming 4 February 27th 05 11:04 PM
Testing for content in Range Jim McLeod[_3_] Excel Programming 1 July 13th 04 05:58 PM


All times are GMT +1. The time now is 02:57 PM.

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"