hello all
i have a macro that imports data from a text file and then creates a chart from this data. The problem is that the data in the text file varies and i need the macro to read from a specified cell to the end of the column/row. At the moment it just selects the same cells regardless of the amount of data imported and therefore misses some data for the chart.
here's the code generated by excel....
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A2:B8"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
Sheets("Chart1").Select
is there a keyword with the .Range( ) call to specify from a point to the end of the data e.g .Range("A2:END")??
v.simple i know but can anybody help
cheers
This message was edited by arab on 2002-08-26 11:56
i have a macro that imports data from a text file and then creates a chart from this data. The problem is that the data in the text file varies and i need the macro to read from a specified cell to the end of the column/row. At the moment it just selects the same cells regardless of the amount of data imported and therefore misses some data for the chart.
here's the code generated by excel....
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A2:B8"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
Sheets("Chart1").Select
is there a keyword with the .Range( ) call to specify from a point to the end of the data e.g .Range("A2:END")??
v.simple i know but can anybody help
cheers
This message was edited by arab on 2002-08-26 11:56