More range name issues
I wonder if this might be my problem (where I'm defining the range) within
user form code.
RangeName = "PlanYear" & ActiveCell.Offset(0, 1).Value
Seriesrange = Me.cboPlanYear.Value
ThisWorkbook.Names.Add Name:=RangeName, RefersTo:="=" & Seriesrange
RangeName = "PlanMonth" & ActiveCell.Offset(0, 1).Value
Seriesrange = Me.cboPlanMonth.Value
ThisWorkbook.Names.Add Name:=RangeName, RefersTo:="=" & Seriesrange
Year is in form 2001, 2002, 2003
Month is in form January, February, March
"Bob Phillips" wrote:
Are you on the same sheet? Maybe try qualifying with the sheet.
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"Barb Reinhardt" wrote in message
...
I have the following code:
Debug.Print ActiveCell.Offset(0, 1).Value
sRangeName = "PlanYear" & ActiveCell.Offset(0, 1).Value
Debug.Print sRangeName
Debug.Print "Range Value = ", Range(sRangeName).Value
ActiveCell.Offset(0,1).value = 1
the range name "PlanYear1" has a value of zero right now. The
definition
shows
=0
at this point in time.
AWS is the activesheet.
sRangeName is a string.
WHAT am I missing?
Thanks
|