![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 3
|
Hello-
I have a simple task that I need help with... I have a spreadsheet which imports data from a text file. The data can change, meaning that it can have 10 rows one day, perhaps 20 the other. I can calculate the number of rows using the following line of code... RowCount = WorksheetFunction.CountA(.Columns(1)) Now I need to set the range for a chart based on the number of rows using SetSourceData. The range will always start at cell A1, how do I tell Excel to add the number from RowCount to the range for SetSourceData? Thanks- Thomas |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: London, UK
Posts: 167
|
rowcount = Range("a1").End(xlDown).Row
ActiveSheet.ChartObjects("chart 2").Activate ActiveChart.SetSourceData Source:=Sheets("Sheet6").Range("A1:B" & rowcount), PlotBy:= _ xlColumns
__________________
<table style="background-color:#0e54be" cellspacing="1" cellpadding="2"><td style="background-color:#ceffff;font-family:arial;color:#072c63;font-size:8pt;">***DALEY** :P**</td></table> |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Ahmedabad Gujarat
Posts: 303
|
There are different way where you can make your range dynamic.
I have able to list some ways in my file no. 16 'Populating Combobox' see if it can be helpful to you. http://www.pexcel.com/download.htm nishith desai http://www.pexcel.com |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|