View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
johnrkeir johnrkeir is offline
external usenet poster
 
Posts: 2
Default Macro producing chart from variable length column

Thanks, I used Sheets("Sheet1") ... and it worked.

"Myrna Larson" wrote:

Is the chart embedded or on a separate sheet? If the latter, which is the
active sheet when the code runs? Is there an active chart?

Will it work correctly if you refer to the worksheet by name -- e.g.
Worksheets("Sheet1")

and refer to the chart by name?


On Wed, 27 Oct 2004 19:49:05 -0700, johnrkeir
wrote:

I get Run-time error 438, Object doesn't support this property or method.

"Myrna Larson" wrote:

Assuming that it's all on one line in your code, it looks OK to me. What

error
are you getting?

On Wed, 27 Oct 2004 19:15:03 -0700, "johnk"


wrote:

I'm trying to produce a chart in excel from variable length column using a
macro. I find the bottom of the column and assign the row number to

variable
K. I then want to assign the SeriesCollection XValues and Values but

can't
seem to do it using the Cells notation as shown below. Is there another

way
to approach this using the variable K for the last row in the range?

ActiveChart.SeriesCollection(1).XValues =
ActiveSheet.Range(ActiveSheet.Cells(2, 1), ActiveSheet.Cells(K, 1))

Thanks