Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Marie J-son
 
Posts: n/a
Default 3 cells are named - how to refere to them in one reference field in a chart

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  
John Mansfield
 
Posts: n/a
Default

You can use code like the following to refer to the range
name for the series . . .

ActiveChart.SeriesCollection(1).Values = "='filename.xls'!
Rangename"

I'm not aware that you can easily do the same thing for
each individual point within the series. That would imply
that you are trying to chart a group of noncontiguous
ranges within a single series which does not sound too
efficient.

Hope this helps.

John Mansfield

-----Original Message-----
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


.

  #3   Report Post  
John Mansfield
 
Posts: n/a
Default

Just an unpdate - you can refer to several range names in
your code if you seperate them by commas and keep the
filenames in apostrophies. This example shows two ranges
but I think the syntax is what you're trying to get at for
your three range name question.

ActiveChart.SeriesCollection(1).Values = "='yourfile.xls'!
Rname1, 'yourfile.xls'!Rname2"

Ragards

John Mansfield


-----Original Message-----
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


.

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



All times are GMT +1. The time now is 04:11 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"