L
Larry
I have a worksheet containing two autoshapes (rounded rectangle) allowing the
user to activate or deactivate a macro by clicking on an autoshape. Sub
TurnOff macro is assigned to rounded rectangle with inserted text of "DATA
Mode". Sub TurnOn macro is assigned to rounded rectangle with inserted text
of "POSTER Mode". This code will alternately change the background color of
rounded rectangles, allowing the user to know which mode is activated. e.g.
if DATA Mode is activated, DATA mode rounded rectangle will turn green,
POSTER Mode rectangle will have no fill visible, and vice-versa. To make the
code work correctly, I need to change the "AutoShape 1/2" in the code to
match the actual names of the objects the macros are assigned to. So far,
changing the names to 'DATA Mode', 'POSTER Mode' 'rounded rectangle', or
'rounded rectangle 1/2' have not worked. I continue to receive the error
message "The item with the specified name wasn't found". I would appreciate
any suggestions.
Sub TurnOff()
Application.EnableEvents = False
Dim myCell As Range
Set myCell = ActiveCell
ActiveSheet.Shapes("AutoShape 1").Select
Selection.ShapeRange.Fill.Visible = msoFalse
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoTrue
myCell.Select
End Sub
Sub TurnOn()
Application.EnableEvents = True
Dim myCell As Range
Set myCell = ActiveCell
ActiveSheet.Shapes("AutoShape 1").Select
Selection.ShapeRange.Fill.Visible = msoTrue
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoFalse
myCell.Select
End Sub
Regards,
Larry
user to activate or deactivate a macro by clicking on an autoshape. Sub
TurnOff macro is assigned to rounded rectangle with inserted text of "DATA
Mode". Sub TurnOn macro is assigned to rounded rectangle with inserted text
of "POSTER Mode". This code will alternately change the background color of
rounded rectangles, allowing the user to know which mode is activated. e.g.
if DATA Mode is activated, DATA mode rounded rectangle will turn green,
POSTER Mode rectangle will have no fill visible, and vice-versa. To make the
code work correctly, I need to change the "AutoShape 1/2" in the code to
match the actual names of the objects the macros are assigned to. So far,
changing the names to 'DATA Mode', 'POSTER Mode' 'rounded rectangle', or
'rounded rectangle 1/2' have not worked. I continue to receive the error
message "The item with the specified name wasn't found". I would appreciate
any suggestions.
Sub TurnOff()
Application.EnableEvents = False
Dim myCell As Range
Set myCell = ActiveCell
ActiveSheet.Shapes("AutoShape 1").Select
Selection.ShapeRange.Fill.Visible = msoFalse
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoTrue
myCell.Select
End Sub
Sub TurnOn()
Application.EnableEvents = True
Dim myCell As Range
Set myCell = ActiveCell
ActiveSheet.Shapes("AutoShape 1").Select
Selection.ShapeRange.Fill.Visible = msoTrue
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoFalse
myCell.Select
End Sub
Regards,
Larry