Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you can use worksheet_change event to control the same.
For example if you want to do this based on your hidden A row Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Application.ScreenUpdating = False For Each cell In Range("A5:A60") If cell.Value = 0 Then cell.EntireRow.Hidden = True ElseIf cell.Value = 1 Then cell.EntireRow.Hidden = False End If Next Application.ScreenUpdating = True End Sub Nick wrote: Hi, I have seen lots of examples but can't get any to work - I have a job sheet with approx 60 rows - the rows contain data applicable to various types of job. What I want to do is have the user select which job type they are completing, and then automatically hide/unhide the rows that aren't relevant to that job. I have added a hidden column A with an If statement that returns 1 or 0 depending on if the row should be shown/hidden 1 to show - 0 to hide)based on what the user picks as the job type. Can anyone help with some sample code and maybe advice on how I can get this to work ? Thanks.. Nick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can visual basics hide rows based on cell values? | Excel Discussion (Misc queries) | |||
hide rows based on cell value | New Users to Excel | |||
hide rows based on value in cell | Excel Discussion (Misc queries) | |||
Hide/Delete entire rows based in the content of one cell | Excel Discussion (Misc queries) | |||
Code to hide rows based on cell contents | Excel Programming |