J
Jeff Reed
All,
I am trying to create macros for some ellipse objects on my sheet so that
when a user clicks on it it will turn either white or red depending on what
color it is already. I can't figure out how to determine what the index is
for the object so I can reference it in the Fill command.
Here is the code I have so far for one of the ellipses.
Sub Oval78_Click()
If Worksheets(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 255, 255) Then
Worksheets(1).Shapes(1).Fill.Background.RGB = RGB(255, 0, 0)
Else
Worksheets(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 0, 255)
End If
End Sub
Now I assumed that the index number was 78 as in the objects name"Oval78",
but that doesn't seem to change the color. I dont get any errors nor do I
see anything actually change colors.
I am using index number 1 because thats the only thing that doesnt give me a
error.
Can any one provide me with some tips?
TIA
Jeff Reed
I am trying to create macros for some ellipse objects on my sheet so that
when a user clicks on it it will turn either white or red depending on what
color it is already. I can't figure out how to determine what the index is
for the object so I can reference it in the Fill command.
Here is the code I have so far for one of the ellipses.
Sub Oval78_Click()
If Worksheets(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 255, 255) Then
Worksheets(1).Shapes(1).Fill.Background.RGB = RGB(255, 0, 0)
Else
Worksheets(1).Shapes(1).Fill.ForeColor.RGB = RGB(255, 0, 255)
End If
End Sub
Now I assumed that the index number was 78 as in the objects name"Oval78",
but that doesn't seem to change the color. I dont get any errors nor do I
see anything actually change colors.
I am using index number 1 because thats the only thing that doesnt give me a
error.
Can any one provide me with some tips?
TIA
Jeff Reed