Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Range Name question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Range Name question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Range Name question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Range question mnewnam Excel Programming 0 October 28th 04 06:51 PM
range question Simon Sunke Excel Programming 0 February 23rd 04 02:41 PM
range question Simon Sunke Excel Programming 0 February 23rd 04 02:39 PM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"