radames.rios
New Member
- Joined
- Nov 30, 2012
- Messages
- 11
Hi people! I'm fairly new to VBA and I'll appreciate your help on this.
I have an argument in which I'm defining a named range, the argument is as follows:
ActiveSheet.Names.Add Name:="JanMax", RefersTo:=ActiveSheet.Range(max)
In this line, I'm creating a range with the name "JanMax" and it refers to a range contained in the variable max (in the form A6:A12 for example). This argument works just fine.
However, instead of naming the name writing a string, I would like to write the string in a variable and put the variable in the argument. For example:
Dim rangename as string
rangename = "JanMax"
ActiveSheet.Names.Add Name:=rangename, RefersTo:=ActiveSheet.Range(max)
Any idea on how can I do this?
I have an argument in which I'm defining a named range, the argument is as follows:
ActiveSheet.Names.Add Name:="JanMax", RefersTo:=ActiveSheet.Range(max)
In this line, I'm creating a range with the name "JanMax" and it refers to a range contained in the variable max (in the form A6:A12 for example). This argument works just fine.
However, instead of naming the name writing a string, I would like to write the string in a variable and put the variable in the argument. For example:
Dim rangename as string
rangename = "JanMax"
ActiveSheet.Names.Add Name:=rangename, RefersTo:=ActiveSheet.Range(max)
Any idea on how can I do this?