View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default More range name issues

I'm getting an error on this line

Debug.Print "PlanDate1", Range("PlanDate1").Value

when I go into the worksheet and enter =PlanDate1, I have NO problem.

The error is Runtime Error 1004,
method Range of object worksheet failed.

Remember, PlanDate1 is defined to be
=1
in the range name definitions sheet.

"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