ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hide excel sheets (https://www.excelbanter.com/excel-programming/423916-hide-excel-sheets.html)

Sunil Sagar

hide excel sheets
 
I want to hide worksheet in excel worksheet using combo-box.
This combobox has got 2 options : "YES" and "NO"

For "NO" this will hide the worksheet and vice versa.

Please help, how it can be configured.
Sunil

Mike H

hide excel sheets
 
Hi,

Try this, the text for 'Yes

Private Sub ComboBox1_Click()
If UCase(ComboBox1.Text) = "YES" Then
Sheets("Sheet1").Visible = False
Else
Sheets("Sheet1").Visible = True
End If
End Sub

Mike

"Sunil Sagar" wrote:

I want to hide worksheet in excel worksheet using combo-box.
This combobox has got 2 options : "YES" and "NO"

For "NO" this will hide the worksheet and vice versa.

Please help, how it can be configured.
Sunil


Mike H

hide excel sheets
 
I meant to say

Try this, the text for 'YES' is meant to be upper case

"Mike H" wrote:

Hi,

Try this, the text for 'Yes

Private Sub ComboBox1_Click()
If UCase(ComboBox1.Text) = "YES" Then
Sheets("Sheet1").Visible = False
Else
Sheets("Sheet1").Visible = True
End If
End Sub

Mike

"Sunil Sagar" wrote:

I want to hide worksheet in excel worksheet using combo-box.
This combobox has got 2 options : "YES" and "NO"

For "NO" this will hide the worksheet and vice versa.

Please help, how it can be configured.
Sunil


Sunil Sagar

hide excel sheets
 
Great !!

thanks for the prompt reply Mike, It worked !!

"Mike H" wrote:

I meant to say

Try this, the text for 'YES' is meant to be upper case

"Mike H" wrote:

Hi,

Try this, the text for 'Yes

Private Sub ComboBox1_Click()
If UCase(ComboBox1.Text) = "YES" Then
Sheets("Sheet1").Visible = False
Else
Sheets("Sheet1").Visible = True
End If
End Sub

Mike

"Sunil Sagar" wrote:

I want to hide worksheet in excel worksheet using combo-box.
This combobox has got 2 options : "YES" and "NO"

For "NO" this will hide the worksheet and vice versa.

Please help, how it can be configured.
Sunil



All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com