Hide/Unhide Command Button

xc405

Board Regular
Joined
Jul 2, 2011
Messages
54
I have a command button "Calculate", i want it to be hidden until the user clicks a button called "New Facility" on a different sheet. I'm not sure how to upload my workbook so I'll give you a quick explanation of how i would like it be hidden.

Sheet 1-GeneralInfo: Fills out info
Sheet 2-SiteInformation: Fills out info----Command Button Calculate is hidden.
Sheet 3 to 4-Checklist, Stacks: Fills out info
Sheet 5-Flowchart: Clicks the "New Facility" button and it takes you back to Sheet 2 and unhides the "Calculate" command button.

Here is my code for the "Calculate" button:
Code:
Sub Calculate_Click()
    Dim ws As Worksheet
    Set ws = Worksheets("LossesSummary")
    ws.Activate
    MsgBox "This Sheet does not calculate Flare Loss." & vbCrLf & "By clicking the Flare checkbox you only show that you plan on installing a Flare.", vbOKOnly, "devon Energy"
End Sub

Any help would be appreciated :)!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Where did these buttons come from? - The Forms, or the Controls Toolbox toolbar?

If you use a button from Controls Toolbox (these are ActiveX controls) then you can go into the properties for your 'Calculate' button and name it. (I named it 'CalcButton'.) Then, down at the bottom of the button's properties, set the Visible property to False.

In the code of your New Facility button, you can include something like:
Code:
With Sheets("SiteInformation")
  .Activate
  .CalcButton.Visible = True
End With

You'll have to figure out what criteria you want met before resetting the button's visible property back to False, but you can do that the same way too.

Does that help?
 
Upvote 0
They aren't activeX controls because I use a Mac but they are forms from the toolbox. If they were activeX it would be easy but I'm not sure how to get it to work.
 
Upvote 0

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

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 MrExcel.com.
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 "mrexcel.com".
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
Back
Top