Hide/Unhide Rows based on ComboBox

  • Thread starter Thread starter cmk18
  • Start date Start date
C

cmk18

I am creating a survey in Excel, and based on the selections that th
respondents make in certain combo boxes I want certain other question
to appear. I've already hidden the rows with the desired question
using the rows.Hidden method, but I don't know how to unhide them base
on the combo box selection using VBA.

Thank
 
Something like

Select Case Combobox1.Value
Case "Alpha": Rows("3:4").Hidden = False
Case "Beta": Rows("11:13").Hidden = False

Case "Gamma": Rows("8:16").Hidden = False
'etc
End Select
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
I totally forgot, this is for a DV cell, not a combo box, I know tha
the code shouldn't be too divergent, but I get totally lost with som
of these things. Thanks

c
 
In that case, the DV is irrelevant, as you only need to test the cell value,
something akin to

Select Case Range("H99").Value
Case "Alpha": Rows("3:4").Hidden = False
Case "Beta": Rows("11:13").Hidden = False

Case "Gamma": Rows("8:16").Hidden = False
'etc
End Select

change H99 to the DV cell.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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