I would like to add a named range to a macro that I have. The problem I have is that I want the name of the range to be based on a variable. I have defined the variables at the top of the data and what I need to do is to add a name range based on the CurMonth and also MC or SY. I have been unable to find a way of doing this so far. If I haven't provided enough info, please let me know
--Global Variables--
Dim MC As Worksheet ' MC01 Data
Dim SY As Worksheet 'SY01 Data
Dim CurMonth(1 To 12) As String
---Initial Part of Macro--
Set MC = Workbooks("Book3.xls").Worksheets(CurMonth(i) & " MC01")
Set SY = Workbooks("Book3.xls").Worksheets(CurMonth(i) & " SY01")
---
--Global Variables--
Dim MC As Worksheet ' MC01 Data
Dim SY As Worksheet 'SY01 Data
Dim CurMonth(1 To 12) As String
---Initial Part of Macro--
Set MC = Workbooks("Book3.xls").Worksheets(CurMonth(i) & " MC01")
Set SY = Workbooks("Book3.xls").Worksheets(CurMonth(i) & " SY01")
---