Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Want to highlight all but first line | New Users to Excel | |||
I cannot drag a Pivot Table field into the page area | Excel Discussion (Misc queries) | |||
Area Under Curve | Excel Worksheet Functions | |||
Bar Chart Label Sizes | Charts and Charting in Excel | |||
Fill area beneath a scatter plot | Charts and Charting in Excel |