Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Le9569
 
Posts: n/a
Default How do I highlight all the context area?

Hello,

I do have a macro that let user select an excel file and create a chart.
However, I am unable to run the chart without knowing the number of rows in
the worksheet.

Here is what I have:

ActiveChart.SetSourceData Source:=Sheets("Sheet1"). _
Range("A1:C374"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Chart1"

The Range("A1:C374") is changing based on the file. How do I get those
dynamically?

Thanks.
le9569

  #2   Report Post  
Gary Brown
 
Posts: n/a
Default

Try
Activesheet.usedrange
HTH,
Gary Brown

"Le9569" wrote:

Hello,

I do have a macro that let user select an excel file and create a chart.
However, I am unable to run the chart without knowing the number of rows in
the worksheet.

Here is what I have:

ActiveChart.SetSourceData Source:=Sheets("Sheet1"). _
Range("A1:C374"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Chart1"

The Range("A1:C374") is changing based on the file. How do I get those
dynamically?

Thanks.
le9569

  #3   Report Post  
Le9569
 
Posts: n/a
Default

Thank you.

"Gary Brown" wrote:

Try
Activesheet.usedrange
HTH,
Gary Brown

"Le9569" wrote:

Hello,

I do have a macro that let user select an excel file and create a chart.
However, I am unable to run the chart without knowing the number of rows in
the worksheet.

Here is what I have:

ActiveChart.SetSourceData Source:=Sheets("Sheet1"). _
Range("A1:C374"), PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Chart1"

The Range("A1:C374") is changing based on the file. How do I get those
dynamically?

Thanks.
le9569

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
Want to highlight all but first line Laurel New Users to Excel 0 March 6th 05 10:30 PM
I cannot drag a Pivot Table field into the page area KimboR Excel Discussion (Misc queries) 2 February 23rd 05 02:29 PM
Area Under Curve Ray Naidu Excel Worksheet Functions 2 January 15th 05 11:11 PM
Bar Chart Label Sizes [email protected] Charts and Charting in Excel 2 December 27th 04 03:19 PM
Fill area beneath a scatter plot JZip Charts and Charting in Excel 4 December 8th 04 01:59 PM


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