LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
JF_01
 
Posts: n/a
Default .XValues syntax problem

I am writing a macro that includes assigning x-values from the third column
of Sheet 1 to the active chart:

ActiveChart.SeriesCollection(1).XValues = Sheets("Sheet1").Range("C2:C105")

However, when I change the range-referencing to cells-style, I get an error:

ActiveChart.SeriesCollection(1).XValues =
Sheets("Sheet1").Range(Cells(1,3),Cells(105,3))

The error says: "Method of 'Cells' of object '_Global' failed

Does the XValues argument not take Cells-style referencing? I ask because
what I really want to do is assign a variable to the range that changes
according to the number of rows in the column that contain data:

ActiveChart.SeriesCollection(1).XValues =
Sheets("Sheet1").Range(Cells(1,3),Cells(num_rows,3 ))
 
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
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Syntax problem Alex H Excel Worksheet Functions 1 July 2nd 05 08:23 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
problem office assistant R.VENKATARAMAN Excel Discussion (Misc queries) 0 June 15th 05 06:22 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"