Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a range name that's called "PlanMonth1" and I'd like to reference it
within my code. What I want to do is something like this: Debug.Print "Range Value = ", Range("PlanMonth" & ActiveCell.Offset(0, -1).Value).Value but I'm getting an error. What am I doing wrong? Thanks Method Range of object worksheet failed. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you have additional named ranges like
PlanMonth1 and activecell.offset(0,-1) contains 1, and PlanMonth1 refers to a single cell, then that should work. -- Regards, Tom Ogilvy "Barb Reinhardt" wrote: I have a range name that's called "PlanMonth1" and I'd like to reference it within my code. What I want to do is something like this: Debug.Print "Range Value = ", Range("PlanMonth" & ActiveCell.Offset(0, -1).Value).Value but I'm getting an error. What am I doing wrong? Thanks Method Range of object worksheet failed. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Providing the cell left of the activecell contains '1' and you have a named
range "PlanMonth1" your code should work. That is assuming the named range is only one cell, otherwise it would return an array of values. Trust the responses from Jim Thomlinson and I to your post yesterday answered your question. Regards, Peter T "Barb Reinhardt" wrote in message ... I have a range name that's called "PlanMonth1" and I'd like to reference it within my code. What I want to do is something like this: Debug.Print "Range Value = ", Range("PlanMonth" & ActiveCell.Offset(0, -1).Value).Value but I'm getting an error. What am I doing wrong? Thanks Method Range of object worksheet failed. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range question | Excel Programming | |||
range question | Excel Programming | |||
range question | Excel Programming | |||
Range.Formula and Range question using Excel Automation | Excel Programming |