ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   red point (https://www.excelbanter.com/excel-programming/326371-red-point.html)

Paul

red point
 
the following code colors a point on the chart line red
when I change the 4th line to

ActiveChart.SeriesCollection(1).Points(1500).Selec t

the same line below contains the variable Rowx and it does
not work. what did I do wrong????

Sub redpoint()

Rowx = [bf44] - 792

ActiveSheet.ChartObjects("Chart 23").Activate
ActiveChart.SeriesCollection(1).Points("Rowx").Sel ect

With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlSquare
.MarkerSize = 5
End With
End Sub

Charlie

red point
 
Try removing the quotes around "Rowx"

"Paul" wrote:

the following code colors a point on the chart line red
when I change the 4th line to

ActiveChart.SeriesCollection(1).Points(1500).Selec t

the same line below contains the variable Rowx and it does
not work. what did I do wrong????

Sub redpoint()

Rowx = [bf44] - 792

ActiveSheet.ChartObjects("Chart 23").Activate
ActiveChart.SeriesCollection(1).Points("Rowx").Sel ect

With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlSquare
.MarkerSize = 5
End With
End Sub


Toppers

red point
 
Paul,

ActiveChart.SeriesCollection(1).Points(Rowx).Selec t


"Rowx" (in quotes) is treated as a string not a number variable which I
think is what you want.

HTH

"Paul" wrote:

the following code colors a point on the chart line red
when I change the 4th line to

ActiveChart.SeriesCollection(1).Points(1500).Selec t

the same line below contains the variable Rowx and it does
not work. what did I do wrong????

Sub redpoint()

Rowx = [bf44] - 792

ActiveSheet.ChartObjects("Chart 23").Activate
ActiveChart.SeriesCollection(1).Points("Rowx").Sel ect

With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlSquare
.MarkerSize = 5
End With
End Sub



All times are GMT +1. The time now is 03:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com