Experts kindly help!

  • Thread starter Thread starter courtesio99
  • Start date Start date
C

courtesio99

Can anyone help me with the following problem?

I have a dropdown list, e.g. with 4 options.
Each option is represented by a row of data below the cell with the
list, and each cell in each row is to be entered by the user. (That
means I have 4 rows of data.)

How do I unhide a certain row that is selected via the drop down list
whilst hiding the rest of the 3 rows?
 
To hide rows dependent on the data within them you would have to use
macro.....in which case your questions would be better answered in th
'programming' forum.

If I understand it right the user inputs 4 sets of data in rows an
then selects one of these sets of data from a drop down box?

You could use conditional formatting to highlight the row chosen....th
drop down box will produce a number, 1, 2, 3 or 4 in a 'cell link', yo
could then insert the conditional formatting which would turn the tex
red if say 2 were selected
 
If your dropdown list is done via validation, you can use this event
macro:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Static vArr As Variant
Dim i As Long
With Target
If Not Intersect(Range("A1"), Target) Is Nothing Then
If IsEmpty(vArr) Then _
vArr = Array("value1", "value2", _
"value3", "value4")
For i = 0 To UBound(vArr)
.Offset(i + 1, 0).EntireRow.Hidden = _
.Value <> vArr(i)
Next i
End If
End With
End Sub

where you change "value1","value2", etc for the values in your
validation list, and change "A1" to suit.
 
Back
Top