Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Conditional Hiding of Rows

Status
Not open for further replies.

AlsGal52

Programmer
Aug 9, 2003
33
US
First, our company uses Office 2000.

I want to create a form that managers have to fill out that has approximately 75 questions. Depending on what employee level the associate is (answer entered in cell B9) determines which questions the manager wants to show up in the rows below in which they have to answer. This means, if the employee level is 20, the manager only wants to see Questions 1-10, 17-25, and 45-57 to show below which makes it easier for them to answer only questions that apply to employee level 20. All other rows need to be hidden.

Is there a way to do this?
 
Tis is one of possible solutions:

[tt]Dim QuestionRanges(1 To 20) As Range
With Worksheets(1)
Set QuestionRanges(1) = Union(.Range("A2:A3"), .Range("A7"))
Set QuestionRanges(2) = .Range("A2:A3")
End With
' ...
Worksheets(1).Rows.Hidden = False
QuestionRanges(1).EntireRow.Hidden = True
MsgBox "Rows of first range are hidden"
Worksheets(1).Rows.Hidden = False[/tt]

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top