Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default defining a variable-size worksheet area for charting

How to define a variable-size area in a time-series chart-creating macro that
would include all the data in a worksheet, starting for example from cell B6?
RyGuy suggested using

Sub Ender()
Range("B6").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
End Sub

but how to include these values in the chart-creating code instead of the
direct "B6:E100" address in the example given below?

Sheets("Data").Select
Range("B6").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Data").Range("B6:E100")
ActiveChart.Location Whe=xlLocationAsObject, Name:="Data"

z.entropic

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
Defining Font Size in VBA CherylH Excel Discussion (Misc queries) 2 August 13th 07 06:48 PM
defining a variable-size worksheet area for copying & pasting z.entropic Excel Worksheet Functions 3 August 11th 07 09:30 PM
Defining UserForm Caption from a Variable [email protected] Excel Worksheet Functions 1 January 3rd 07 02:30 PM
How do I Add a variable in the legend without charting the data? Legends vs Plotting Charts and Charting in Excel 1 September 11th 06 08:00 PM
Defining maximum value from a named range for charting purposes Barb Reinhardt Charts and Charting in Excel 2 March 8th 06 04:11 PM


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