View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Hiding rows based on a column value

try this which sorts and then hides all but what is in b1. assign to buttons
or assign the 1st on to a worksheet_change event. You could have mv be the
result of an inputbox.

Sub sortandhide()
Cells.EntireRow.Hidden = False
Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row).Sort key1:=Range("a2")
mv = Range("b1") '"yourvalue"
fr = Columns(1).Find(mv).Row
'MsgBox fr
If fr 2 Then Rows("2:" & fr - 1).EntireRow.Hidden = True
lr = Application.Match(mv, Columns(1))
'MsgBox lr
Rows(lr + 1 & ":" & Cells(Rows.Count, "a").End(xlUp).Row +
1).EntireRow.Hidden = True
End Sub

Sub unhiderows()
Cells.EntireRow.Hidden = False
End Sub

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
I like the results of this approach but don't like the look of the drop
down options for every heading. Is there a way to achieve the same
results but not have the drop down options available for the user to
adjust? I want to have a little more control over the interface.