Grizlore
Active Member
- Joined
- Aug 22, 2006
- Messages
- 259
Right Guys, having a slight problem.
I need to name some cells to allow listing in a list via validation. I'll add a "=Unique" with the list properties of a cell, anyway.....I can get this to work be simply highlighting them and then naming them, but i would like to do this via VB, to allow for updates etc.
Firstly I had a problem as i couldn't overwrite or change what i had originally done.
I fixed that with this at the start of my code
BUT.... Even though the next VB selects the cells i want....
To selected cells are not 'named', only the original cells are named and not the ones which have been added.
Here is my full code so far...
I know this is likely to be something to do with Relative Cell Ref's etc, but either with Relative turned on or off... I can't sort it!!!
Could anyone help please?
I need to name some cells to allow listing in a list via validation. I'll add a "=Unique" with the list properties of a cell, anyway.....I can get this to work be simply highlighting them and then naming them, but i would like to do this via VB, to allow for updates etc.
Firstly I had a problem as i couldn't overwrite or change what i had originally done.
I fixed that with this at the start of my code
Code:
ActiveWorkbook.Names.Item("Unique").Delete
Code:
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
To selected cells are not 'named', only the original cells are named and not the ones which have been added.
Here is my full code so far...
Code:
ActiveWorkbook.Names.Item("Unique").Delete
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Names.Add Name:="Unique", RefersToR1C1:= _
"='Glue Weights'!R2C1:R9C1"
Could anyone help please?