Hide or display worksheets based on form

  • Thread starter Thread starter Shawnn
  • Start date Start date
S

Shawnn

Worksheet 1 displays a list of questions. Based on the answer of those
questions (via checkbox), I would like to display different worksheets. For
example the worksheet one is always displayed. If you select yes to question
#1, then worksheet 2 appears. If you select yes to question #2 then
worksheet 3 also appears. Can this be done?
 
Hi,

Assuming you have a separate checkbox for each sheet the code for each would
look something like this

Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Sheet2.Visible = xlSheetVisible
Else
Sheet2.Visible = xlSheetHidden
End If
End Sub
 
Hi again,

I realize I should add that in the notation

Sheet2.Visible = xlSheetVisible

Sheet2 is the code windows name for the sheet if you use the spreadsheet
name you must write the above line as

Sheets("Sheet2").Visible = xlSheetVisible
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top