Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
rhsiao
 
Posts: n/a
Default setting XValues property when charting using macros

Hello,

I hope this message finds you well. I had a quick question concering
XValues syntax.

I am trying to set the XValues of series 3 in Chart 1 of Sheet1. I am
trying to use the values within cells C33 to C35 for the XValues.

The code I am using is listed as follows:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries

ActiveChart.SeriesCollection(3).XValues =
Worksheets("Sheet1").Range(.Cells(33, 3), .Cells(35, 3))


Apparently, there is compile error when I use .Cell in my code. The error
message is: Invalid or unqualified reference. I've checked the syntax
against the VB reference manuals, and it appears correct.

Does anybody have any ideas? Thanks and have a wonderful day!
  #2   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope
 
Posts: n/a
Default setting XValues property when charting using macros

Hi,

You would use .Cells within a With block. The following is untested but
the syntax should work.

With Worksheets("Sheet1")
ActiveChart.SeriesCollection(3).XValues =
.Range(.Cells(33, 3), .Cells(35, 3))
End with

Cheers
Andy

rhsiao wrote:
Hello,

I hope this message finds you well. I had a quick question concering
XValues syntax.

I am trying to set the XValues of series 3 in Chart 1 of Sheet1. I am
trying to use the values within cells C33 to C35 for the XValues.

The code I am using is listed as follows:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries

ActiveChart.SeriesCollection(3).XValues =
Worksheets("Sheet1").Range(.Cells(33, 3), .Cells(35, 3))


Apparently, there is compile error when I use .Cell in my code. The error
message is: Invalid or unqualified reference. I've checked the syntax
against the VB reference manuals, and it appears correct.

Does anybody have any ideas? Thanks and have a wonderful day!


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.charting
rhsiao
 
Posts: n/a
Default setting XValues property when charting using macros

Mr. Pope,

I'm not sure if you check old threads, but I wanted to thank you for your
help. Your tip was right on! Thanks!



"Andy Pope" wrote:

Hi,

You would use .Cells within a With block. The following is untested but
the syntax should work.

With Worksheets("Sheet1")
ActiveChart.SeriesCollection(3).XValues =
.Range(.Cells(33, 3), .Cells(35, 3))
End with

Cheers
Andy

rhsiao wrote:
Hello,

I hope this message finds you well. I had a quick question concering
XValues syntax.

I am trying to set the XValues of series 3 in Chart 1 of Sheet1. I am
trying to use the values within cells C33 to C35 for the XValues.

The code I am using is listed as follows:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries

ActiveChart.SeriesCollection(3).XValues =
Worksheets("Sheet1").Range(.Cells(33, 3), .Cells(35, 3))


Apparently, there is compile error when I use .Cell in my code. The error
message is: Invalid or unqualified reference. I've checked the syntax
against the VB reference manuals, and it appears correct.

Does anybody have any ideas? Thanks and have a wonderful day!


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #4   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope
 
Posts: n/a
Default setting XValues property when charting using macros

Thanks for letting us know.

Cheers
Andy

rhsiao wrote:
Mr. Pope,

I'm not sure if you check old threads, but I wanted to thank you for your
help. Your tip was right on! Thanks!



"Andy Pope" wrote:


Hi,

You would use .Cells within a With block. The following is untested but
the syntax should work.

With Worksheets("Sheet1")
ActiveChart.SeriesCollection(3).XValues =
.Range(.Cells(33, 3), .Cells(35, 3))
End with

Cheers
Andy

rhsiao wrote:

Hello,

I hope this message finds you well. I had a quick question concering
XValues syntax.

I am trying to set the XValues of series 3 in Chart 1 of Sheet1. I am
trying to use the values within cells C33 to C35 for the XValues.

The code I am using is listed as follows:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection.NewSeries

ActiveChart.SeriesCollection(3).XValues =
Worksheets("Sheet1").Range(.Cells(33, 3), .Cells(35, 3))


Apparently, there is compile error when I use .Cell in my code. The error
message is: Invalid or unqualified reference. I've checked the syntax
against the VB reference manuals, and it appears correct.

Does anybody have any ideas? Thanks and have a wonderful day!


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM
Property Let: assign return value of Double when passing String Tetsuya Oguma Excel Discussion (Misc queries) 1 March 3rd 06 08:01 AM
Error setting shape text property Sarge Charts and Charting in Excel 2 January 11th 06 03:31 AM
Unable to set the XValues property of the Series class ramkumar_cpt Charts and Charting in Excel 5 November 29th 05 02:13 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


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