Excel Conditionally Hiding Specific Cells in Excel

Joined
Mar 1, 2010
Messages
1
Reaction score
0
I am attempting to hide specific cells based on input into a cell and am having some trouble touching on the correct code.

I working on a grading form for a class that I teach and would like comments to be revealed based on a corresponding score. For example, scoring a specific from 0-4, if a 4 is entered in A1 a perfect comment will be revealed in the cell immediately to the right of A1. If a 3 is entered in A1, a new comment will be revealed in the cell immediately to the right of A1 and so on.

Below is the code that I currently have (which is not working) that may help give a better idea of my intention for the worksheet.

'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Dim cell As Range
'If Range("F24") = "3" Then
' Range("H25,H26,H27,H28").EntireRow.Hidden = True
' End If
'If Range("F24") = "2" Then
' Range("H24,H26,H27,H28").Hidden = True
' End If
'If Range("F24") = "1" Then
' Range("H24,H25,H27,H28").Hidden = True
' End If
'If Range("F24") = "0" Then
' Range("H24,H25,H26,H28").Hidden = True
' End If
'End Sub

Any help will be greatly appreciated! Thank you so much!
 
Back
Top