Vba To Change Named RangesMay 12, 2007
I was given the
What I am looking to do is have a range of cells that I have named to be used in a data validation for a drop down box. I have named the cells and would like to have the user name the cells by typing in the name into one cell.
Cells F10:F14 are named "orange" right now (typed in cell F9)
I would like the user to be able to change the name of the cells to whatever they want by changing the cell in F9 - i.e. "banana" and the range is automatically named banana so the data validation can search for Banana instead.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Rng As Range
Set Rng = Range("F9")
If Not Intersect(Target, Rng) Is Nothing Then
Range(oldName).Name = Range("F9")
This Code works great for 1 range - but I have 30 - I can't seem to figure out how to copy it etc for the other 30 ranges.