Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using a Macro to Sum a Variable-Length Range (a Column) | Excel Programming | |||
Using a Macro to Sum a Variable-Length Range (a Column) | Excel Programming | |||
Using a Macro to Sum a Variable-Length Range (a Column) | Excel Programming | |||
Using a Macro to Sum a Variable-Length Range (a Column) | Excel Programming | |||
Using a Macro to Sum a Variable-Length Range (a Column) | Excel Programming |