View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Add break in macro

ActiveSheet.Shapes("AutoShape 67").Select
Select Case Selection.ShapeRange.Fill.ForeColor.SchemeColor
Case 51
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 11
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Case 11
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Case 13
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Case 10
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 51
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Case else
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 11
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
End Select

--
Regards,
Tom Ogilvy


"Thomp" wrote:

Let me first preface by saying I know very little VBA but what I am
wanting to do is to create a macro that changes an autoshape color
each time I click on the autoshape. The macro I have below just runs
from the first color to the last. I want to click the shape and change
the color on each click. In fact it needs to loop so that every time I
click the shape it moves between the four colors chosen. I guess I am
looking for some kind of macro break

Here is my code thus far.

ActiveSheet.Shapes("AutoShape 67").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 11
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 51
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid

thanks in advance
Thomp