CommandButtons not working.


Board Regular
Feb 13, 2020
Office Version
  1. 365
  1. Windows

I have a Navigation tab in a workbook that has buttons to take you to specific sheets.
I have written code so that when the "Plastics" option button is selected columns I:Q are hidden and all buttons within those rows are hidden.
VBA Code:
Private Sub OptionButton2_Click() '''''''Plastics
ActiveSheet.Shapes("CommandButton1").Visible = True
ActiveSheet.Shapes("CommandButton2").Visible = True
ActiveSheet.Shapes("CommandButton3").Visible = True
ActiveSheet.Shapes("CommandButton4").Visible = True
ActiveSheet.Shapes("CommandButton5").Visible = True
ActiveSheet.Shapes("CommandButton6").Visible = True
ActiveSheet.Shapes("CommandButton7").Visible = True
ActiveSheet.Shapes("CommandButton8").Visible = True
ActiveSheet.Shapes("CommandButton9").Visible = True
ActiveSheet.Shapes("CommandButton10").Visible = True
ActiveSheet.Shapes("CommandButton11").Visible = True

ActiveSheet.Shapes("CommandButton12").Visible = False
ActiveSheet.Shapes("CommandButton13").Visible = False
ActiveSheet.Shapes("CommandButton14").Visible = False
ActiveSheet.Shapes("CommandButton15").Visible = False
ActiveSheet.Shapes("CommandButton16").Visible = False
ActiveSheet.Shapes("CommandButton18").Visible = False
ActiveSheet.Shapes("CommandButton19").Visible = False
ActiveSheet.Shapes("CommandButton20").Visible = False
ActiveSheet.Shapes("CommandButton21").Visible = False
ActiveSheet.Shapes("CommandButton22").Visible = False

ActiveSheet.Shapes("CommandButton17").Visible = False
ActiveSheet.Shapes("CommandButton23").Visible = False
ActiveSheet.Shapes("CommandButton24").Visible = False
ActiveSheet.Shapes("CommandButton25").Visible = False
ActiveSheet.Shapes("CommandButton26").Visible = False
ActiveSheet.Shapes("CommandButton32").Visible = False
ActiveSheet.Shapes("CommandButton27").Visible = False
ActiveSheet.Shapes("CommandButton28").Visible = False
ActiveSheet.Shapes("CommandButton29").Visible = False
ActiveSheet.Shapes("CommandButton30").Visible = False
ActiveSheet.Shapes("CommandButton31").Visible = False
ActiveSheet.Shapes("CommandButton32").Visible = False
ActiveSheet.Shapes("CommandButton33").Visible = False
ActiveSheet.Shapes("CommandButton34").Visible = False

ActiveSheet.Shapes("CommandButton35").Visible = False
ActiveSheet.Shapes("CommandButton36").Visible = False
ActiveSheet.Shapes("CommandButton37").Visible = False
ActiveSheet.Shapes("CommandButton38").Visible = False
ActiveSheet.Shapes("CommandButton39").Visible = False
ActiveSheet.Shapes("CommandButton40").Visible = False
ActiveSheet.Shapes("CommandButton42").Visible = False
ActiveSheet.Shapes("CommandButton43").Visible = False
ActiveSheet.Shapes("CommandButton44").Visible = False
ActiveSheet.Shapes("CommandButton45").Visible = False
ActiveSheet.Shapes("CommandButton46").Visible = False
ActiveSheet.Shapes("CommandButton47").Visible = False

Columns("I:Q").Hidden = True
Columns("F:H").Hidden = False
ActiveSheet.Shapes("Group Box 110").Visible = False
End Sub

All other of the Option buttons have similar code. They collapse columns and hide buttons in those specific rows. Leaving one color set of buttons "unhidden" and the two sets of Gray buttons "unhidden".
All of the hiding and unhiding of columns and buttons works.
But all of a sudden the only CommandButtons that are working are the:
- Gray Command Buttons
-Pink "Gen Design Requirements" & "Material Requirements" CommandButtons.

If I click the other buttons a button appears under "educational" as you can see from the image.
When I reopen the file all of the colored buttons appear in that "educational" column stacked on top of each other.

Please let me know if you have any theories to help. I appreciate any efforts!


  • allbuttonss.PNG
    46.4 KB · Views: 14
  • IMG_2108 (1).jpg
    IMG_2108 (1).jpg
    36.7 KB · Views: 16

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Latest member

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back