LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dynamic Range Chart Macro Question

This worked fine for me:

Sub Tester1()
For Each ws In Worksheets
ws.Names.Add Name:=ws.Name & "!EjectaX", _
RefersTo:="=OFFSET('" & ws.Name & "'!$J$1,'" & _
ws.Name & "'!$S$2,0,'" & ws.Name & "'!$S$7-'" _
& ws.Name & "'!$S$2,1)"
Next
End Sub


You need an equal sign in front of the Offset or your formula gets turned
into a text string. You were also missing a ! before $S$2

the name is Sheet1!EjectaX (as an example).

It is shown with the sheet name on the right (as you describe - but that is
the normal way to show it), but the name is as the above.

--
Regards,
Tom Ogilvy


"GerbilGod7 " wrote in message
...
After some tweaking, I've gotten it to work, sorta... Here's what I
use:

ws.Names.Add Name:=ws.Name & "!EjectaX", RefersTo:="OFFSET('" & ws.Name
& "'!$J$1,'" & ws.Name & "'$S$2,0,'" & ws.Name & "'!$S$7-'" & ws.Name &
"'!$S$2,1)"

In each worksheet, it creates a named range with this name:

EjectaX ...[bunch of spaces]... (worksheet name)

I'm not sure why it's doing this; I've tried:

"'" & ws.Name & "'!EjectaX" etc, but it doesn't make a difference.

How do I get it to name these ranges properly, and ultimately graph
them?


---
Message posted from http://www.ExcelForum.com/



 
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
Odd Dynamic Range Question Bongard Excel Discussion (Misc queries) 6 January 7th 10 07:21 PM
Dynamic Chart Question DoubleZ Excel Discussion (Misc queries) 0 November 20th 08 09:51 PM
Chart empty with new data in the dynamic range chart. Feejo Excel Discussion (Misc queries) 16 January 3rd 08 10:03 PM
Dynamic range question Guy Normandeau Excel Discussion (Misc queries) 13 August 2nd 06 07:31 AM
Question regarding dynamic range setting dharmik Excel Worksheet Functions 2 July 22nd 05 08:44 PM


All times are GMT +1. The time now is 09:18 AM.

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"