vba variable

P

Paul

Looks like I am not handling the variable properly in the
following. Can you tell me what I am doing wrong? the 5th
line causes an error.

Sub Macro1()

Dim point As Integer
point = Worksheets("open").Range("aa1").Value

ActiveSheet.ChartObjects("Chart 10").Activate
ActiveChart.SeriesCollection(1).Points(point).Select
With Selection
.MarkerBackgroundColorIndex = 3
.MarkerStyle = xlCircle
.MarkerSize = 11
End With
End Sub
 
M

Mika

I don´t know: your code worked perfectly in my PC.

What does the error message say??

rgd
Mika
 
M

Mika

Hummmm, go for the "obvious" things:

do you have a value in the cell aa1 ???

do you have a serie 1 ???

It looks to me the problem is in your worksheet and not in the code.

Hi, Chip: if you can help me with the working days function it would
be great...
Rgds
Mika
 
P

Paul

Hummmmm is right! aa1 contains integer. chart contains
series 1 , variable is not outside the series display
range.

the code works fine in my computer too -- only if I use a
number rather than the variable - point.

something with the variable causes it to fail
 
M

Mika

Did you debug the var point after reading the value ??

for example:
debug.print point or msgbox point ??

it is reading the value ?

Rgd
Mika
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top