LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto selecting the number of rows!

Hi all!

I was trying to plot values for 2 variables as a XY scatter plot i
Excel, using Macros and recorded a macro while performing the abov
task.
The following is the macro I recorded.

Sub le( )

Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets("Comparison of LE ti
distance"). _
Range("L6")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = _
"='Comparison of LE tip distance'!R2C4:R102C4"
ActiveChart.SeriesCollection(1).Values = _
"='Comparison of LE tip distance'!R2C2:R102C2"
ActiveChart.Location Whe=xlLocationAsObject, Name:= _
"Comparison of LE tip distance"

End Sub


However, in this case since I manually selected the require
rows/columns for the graph, we can see that the cells ranging fro
!R2C4:R102C4 were selected etc....
This might not be the general case. Hence I counted the no: of activ
rows and stored it into a variable called 'i'. I was wondering if ther
would be a way to select the cells like !R2C4:R"i"C4 instead o
!R2C4:R102C4, so that the code can be generalized.

I would appreciate your suggestions guys.
Thanks alot.

Arun.
Vtec Corp

--
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
How can I auto number rows only when data is entered in the same r Plateav Excel Discussion (Misc queries) 3 September 17th 09 11:24 PM
How do you auto-number a large list of rows in Excel? Birdieguy Excel Discussion (Misc queries) 23 May 25th 09 10:56 PM
Auto Number the Rows of Auto Filter Result ashish128 Excel Discussion (Misc queries) 3 April 29th 07 06:41 PM
auto number rows when printing Eduman Excel Discussion (Misc queries) 4 September 11th 06 08:14 PM
Selecting a large number of rows, but not all Katherine New Users to Excel 4 January 27th 05 11:54 PM


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