Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 3 cells are named together - how refere to them in one chart reference field (a seriescollection(1) )

Hi,

I have three cells named and want to use that name in a vba chart procedure
for a xl3DColumnStacked chart

ActiveChart.SeriesCollection(1).Values = sheet1.Range(scol1v)

I used in the procedu
Dim scol1v As String
Let scol1v = "ThreeValues"

Meaningless note:
I used sheet1 as Name and CodeName

In the excel GUI you find the name "ThreeValues" is defined as this
reference:
'sheet1'!$A$1;'sheet1'!$A$4;'sheet1'!$A$6

I thougt it just was to specify the sheet + name, but the debbugger doesn't
like that. what am i doing wrong? Shall I use array() or something? Please
give me a syntax or procedure that works that I can look at...

Regards


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default 3 cells are named together - how refere to them in one chart reference field (a seriescollection(1) )

Hi Marie,

Please
give me a syntax or procedure that works that I can look at...


ActiveChart.SeriesCollection(1).Values =
Activeworkbook.Names("YourName").RefersToRange

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 3 cells are named together - how refere to them in one chart reference field (a seriescollection(1) )

Sounded good, but I can't make it work.
Should I use Dim as String as declaration of the Name, or Range? Do you (or
any other reading this) have some test template etc?

This worked. Is your solution the same?
ActiveChart.SeriesCollection(1).Values = "=" & ActiveWorkbook.Name & "!" &
scol1v
I don't want to use this , please help me through this...


Regards

PS.
I have a lot of charts I want to create in VBA and try to find a way to loop
through them. I have already grouped the multi-ranges etc. with Names and
there is 3 seriecollections with their name, variables and one xValues in
each chart. AS a MVP, maybe you have something to share from your
library...?




"Jan Karel Pieterse" skrev i meddelandet
...
Hi Marie,

Please
give me a syntax or procedure that works that I can look at...


ActiveChart.SeriesCollection(1).Values =
Activeworkbook.Names("YourName").RefersToRange

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default 3 cells are named together - how refere to them in one chart reference field (a seriescollection(1) )

Hi Marie,

This worked. Is your solution the same?


Mine was wrong, I forgot that the seriescollection needs a string address.

ActiveChart.SeriesCollection(1).Values = "=" & ActiveWorkbook.Name & "!" &
scol1v
I don't want to use this


I fail to understand what you *do* want to use, sorry. Could you try and
explain that?

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

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
Adjusting formulas by copying across cells w/o changing the refere Jamie Excel Worksheet Functions 6 July 2nd 09 03:25 PM
Custom error bars bug -- copy pasting chart does not update refere badpazzword Charts and Charting in Excel 5 April 12th 09 02:11 PM
Named range as chart data reference (error) Keith R Charts and Charting in Excel 8 June 13th 07 09:06 PM
3 cells are named - how to refere to them in one reference field in a chart Marie J-son Charts and Charting in Excel 2 December 2nd 04 04:52 PM
Adding to the SeriesCollection of a chart object in VB6 E_R[_27_] Excel Programming 0 August 24th 04 06:38 PM


All times are GMT +1. The time now is 11:08 PM.

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

About Us

"It's about Microsoft Excel"