How to show and hide a worksheet when we select an element of combined combo (list activex) ?

francois.lemarie

Board Regular
Joined
Mar 24, 2010
Messages
54
Hello,

I am working with the following file :
http://depositfiles.com/es/files/qx3unewrn

I have a combolist (ListBox but not in a form, in Activex) with various choices. I want a worksheet to be shown only if I choose "Closed - won". It must be hidden otherwise.

I trew a code but the worksheet is hidden all the time.

What's wrong ? Anyone could be so kind to give me the good code ?

Private Sub ComboStatusopp_Change()
If ComboStatusopp.Value = Closed - won Then
Worksheets("CloseInfo").Visible = True
Else
Worksheets("CloseInfo").Visible = False
End If

End Sub

Thanks a lot
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi, Try:-
Code:
Private [COLOR="Navy"]Sub[/COLOR] ComboStatusopp_Change()
[COLOR="Navy"]If[/COLOR] ComboStatusopp.Value = "Closed - won" [COLOR="Navy"]Then[/COLOR]
    Sheets("CloseInfo").Visible = True
[COLOR="Navy"]Else[/COLOR]
    Sheets("CloseInfo").Visible = False
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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