K
keri
Hi,
I have 26 subs that refer to names. However I have just remembered that
the names are on a list that can be updated.
I thought I would be able to set a global variable for each of the
names and then refer to them in my code.
This is how my sub looks at the moment;
Sheets("chart").Select
ActiveSheet.ChartObjects("CHART 32").Activate
ActiveChart.ChartArea.Select
If ActiveSheet.Range("A26") = False Then
ActiveChart.seriescollection("SMITH").Select
With Selection.Border
.LineStyle = xlNone
My question is 2 part -
1. If i define the names as name1 to 26 as global variables (type =
range), where do I set what each of these refers to? Do i do this is
the sub that refers to the range or do I do this when I am declaring
the global variables?
2. How do I refer to the variable in my code?
Eg this line currently reads....
ActiveChart.seriescollection("SMITH").Select
but instead of the name of the series collection name I need to refer
to the series collection where the name is = to the variable I have
defined as Name1
eg. Set Name1 = sheets.("names").range("a1")
I have 26 subs that refer to names. However I have just remembered that
the names are on a list that can be updated.
I thought I would be able to set a global variable for each of the
names and then refer to them in my code.
This is how my sub looks at the moment;
Sheets("chart").Select
ActiveSheet.ChartObjects("CHART 32").Activate
ActiveChart.ChartArea.Select
If ActiveSheet.Range("A26") = False Then
ActiveChart.seriescollection("SMITH").Select
With Selection.Border
.LineStyle = xlNone
My question is 2 part -
1. If i define the names as name1 to 26 as global variables (type =
range), where do I set what each of these refers to? Do i do this is
the sub that refers to the range or do I do this when I am declaring
the global variables?
2. How do I refer to the variable in my code?
Eg this line currently reads....
ActiveChart.seriescollection("SMITH").Select
but instead of the name of the series collection name I need to refer
to the series collection where the name is = to the variable I have
defined as Name1
eg. Set Name1 = sheets.("names").range("a1")