Private
myText
As
String
Sub
RoundedRectangleSubcategory_Click()
Dim
ws
As
Excel.Worksheet
Dim
shp
As
Shape
Set
ws = Worksheets(
"Risk Category Checklist"
)
Set
shp = ActiveSheet.Shapes(Application.Caller)
ToggleShapeColor
Application.ScreenUpdating =
False
With
shp
If
shp.Fill.ForeColor = RGB(255, 255, 153)
Then
ws.Range(
"$A$5:$W$500"
).AutoFilter , Field:=7, Criteria1:=myText
Else
ws.Range(
"$A$5:$W$500"
).AutoFilter , Field:=7
End
If
End
With
End
Sub
Private
Sub
ToggleShapeColor()
Dim
shp
As
Shape
Set
shp = ActiveSheet.Shapes(Application.Caller)
myText = shp.TextFrame2.TextRange.Characters.Text
With
shp
If
.Fill.ForeColor = RGB(255, 255, 255)
Then
.Fill.ForeColor.RGB = RGB(255, 255, 153)
Else
.Fill.ForeColor.RGB = RGB(255, 255, 255)
End
If
End
With
End
Sub