This might be elementary, but I cannot get it to work.
I need to name range in VBA, work with the named ranges afterwards and change the names. I have split it into e couple of questions below.
1. Naming a range
By using 'Worksheets("Ark1").Range("C4").Name = Worksheets("Ark1").Range("C3").Value' I named cell C4.
This worked fine (but it is the most appropriate method?).
2. Retrieving a name
By using 'Worksheets("Arka").Range("C4").Name' I try to retrieve the name for cell C4, but this does not work for me. In stead of the expected name I get '=Ark1!$C$4'.
How do I retrieve the name (in this case 'Test')?
3. Renaming a range
The next thing I need to do is rename the cell. How do I go about that?
/Soren
I need to name range in VBA, work with the named ranges afterwards and change the names. I have split it into e couple of questions below.
1. Naming a range
By using 'Worksheets("Ark1").Range("C4").Name = Worksheets("Ark1").Range("C3").Value' I named cell C4.
This worked fine (but it is the most appropriate method?).
2. Retrieving a name
By using 'Worksheets("Arka").Range("C4").Name' I try to retrieve the name for cell C4, but this does not work for me. In stead of the expected name I get '=Ark1!$C$4'.
How do I retrieve the name (in this case 'Test')?
3. Renaming a range
The next thing I need to do is rename the cell. How do I go about that?
/Soren