View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Craigm[_52_] Craigm[_52_] is offline
external usenet poster
 
Posts: 1
Default Names.add - Test to see if name already exists?


Thanks to both of you.

Tom, I was struggling with the Selection. part ands was not able to
get that to work.. I was trying Names.Select...with my limited
knowledge I was not able to deduce Selection.Name.

Bob, I was able to get your suggestion to work but I needed to remove
the sFromSheet and "!". Then it works fine. The final code is below.

ThisWorkbook.Names.Add sFromSheet & aYears(i), "=" & Selection.Address

I have moved the ranges around and run the code several times to ensure
it works correctly.

Thank you both for the learning experience. I am going to go back and
try the Selection method.

Gratefully, Craigm


--
Craigm
------------------------------------------------------------------------
Craigm's Profile: http://www.excelforum.com/member.php...o&userid=24381
View this thread: http://www.excelforum.com/showthread...hreadid=537707