in support of this post:
https://excel.tips.net/T001940_Hidin...ell_Value.html
https://excel.tips.net/T001940_Hiding_Rows_Based_on_a_Cell_Value.html
Hello Ryanne
Rather than modifying the coding, it would probably be easier to use a simple "events" type coding which automatically kicks in when a range value is changed in a worksheet. Something of this form:.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.EntireRow.Hidden = True
End Sub
'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
'End Sub
This coding will need to be in a worksheet code module.
Follow , for example these 6 steps to create such a coding:
_1) Right click on the tab of the worksheet of interest
_2) Select View Code
Worksheet code module via View Code after right click on tab.JPG : : https://imgur.com/ZiOuRVT
Attachment 2426
_3) Select the left side drop down list
_4) Select Worksheet
Worksheet.JPG : https://imgur.com/tCwHKBo
Attachment 2427
_5) Select the right drop down list
_6) Select Change
Change.JPG : https://imgur.com/NkbNPsL
Attachment 2428
( Delete or ' comment out any other coding, such as the Private Sub Worksheet_SelectionChange which may have appeared automatically at step 4 )
You can now add your coding within the Private Sub Worksheet_Change
( Hit Alt+F11 to return to spreadsheet view )
The coding will kick off automatically when you change any cell value. It will hide the entire row which contains the cell whose value you changed
In the uploaded file , I have added the coding to the third worksheet code module
Alan
Bookmarks