I understand that this is probably pretty easy, I just dont know how to do it. So please excuse my ignorance on this. I am trying to teach myself.
This is another thread that I started and with the help of another memeber, they were able to write a code that works just the same I want it to per my request....now I want to take it one step further. Thread is here: http://www.excelforum.com/excel-prog...html?p=2674591
This code just selects a cell range.
Now I just want to define or name that range as if I were going to go to FORMULAS > NAME MANAGER > NEW. ....to define it as 'SAMPLENAME'
How do I code that?
Im assuming it goes after:.MergeArea.Offset(, 3).Resize(rows_count, 1).Select
Last edited by clemsoncooz; 01-04-2012 at 04:55 PM.
Try
ThisWorkbook.Names.Add Name:="SampleName", _ RefersTo:=Selection, Visible:=True
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
You can also use
selection.name = "SAMPLENAME"
Good luck.
Thanks to the both of you!
And to clear it out would be:Correct?ActiveWorkbook.Names("SAMPLENAME").Delete
is there a way to clear ALL the names ?
hi clemsoncooz, option to make it:
For Each nm In ActiveWorkbook.Names nm.Delete Next
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks