I just can’t seem to figure this one out. I’m using Excel 2007.
And I have 3 different Rounded Rectangle Shapes on a single worksheet named Cover Page. I’m trying to figure out how to change the line color using VBA with option buttons. Here’s what I have so far. Option button 6 refers to a macro that opens a color chart for custom selection. Any suggestion would be greatly appreciated.
Dim wsh As Worksheet
Dim lngColor As Long
If OptionButton6 Then
lngColor = ShowColor
If lngColor = -1 Then
MsgBox "You didn't select a color!", vbExclamation
Exit Sub
End If
End If
Comment3.Hide
Application.ScreenUpdating = False
With Worksheets("Cover Page").Shapes
.Line.OutlineColor
Select Case True
Case OptionButton1.Value
.Color = RGB(146, 208, 80)
Case OptionButton2.Value
.Color = RGB(120, 220, 255)
Case OptionButton3.Value
.Color = RGB(216, 216, 216)
Case OptionButton4.Value
.Color = RGB(255, 220, 110)
Case OptionButton5.Value
.Color = RGB(250, 100, 95)
Case OptionButton6.Value
.Color = lngColor
End Select
End With
For Each wsh In Worksheets
wsh.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True, _
Password:="", UserInterFaceOnly:=True
ActiveWorkbook.Protect Password:="", Structure:=True, Windows:=True
Next wsh
Application.ScreenUpdating = True
'ActiveWorkbook.Save
End Sub
Bookmarks