Hi Everyone,
I'm currently building a form where I have a number of approval lines at the bottom of a spreadsheet. In most cases, rows 60-63 need to be hidden from view but there are a select number of circumstances where I need to unhide them.
For example, I need to write a code that allows me to unhide rows 60-61 if cell N27 on my spreadsheet is filled in....but then I also need to unhide rows 60-63 if any of the following conditions are met:
Cell B36=True
Cell B46=True
Cell N27="CE"
Cell E28 ="Hrly" And Cell N28 "Ex"
In all other cases not mentioned above, rows 60-63 should remain hidden. Does anyone know how to write a code for something like that? I started to write down some lines below but couldn't figure out how to correctly integrate the N27 piece. I'm fairly new to the VBA syntax.
If Range("N27").Value <> "" Then
Range("60:61").EntireRow.Hidden = False
ElseIf Range("B36").Value = True Or Range("B46").Value = True Or Range("N27").Value = "CE" Or Range("E28").Value = "Hrly" And Range("N28").Value = "Ex" Then
Range("60:63").EntireRow.Hidden = False
Else: Range("60:63").EntireRow.Hidden = True
I'm currently building a form where I have a number of approval lines at the bottom of a spreadsheet. In most cases, rows 60-63 need to be hidden from view but there are a select number of circumstances where I need to unhide them.
For example, I need to write a code that allows me to unhide rows 60-61 if cell N27 on my spreadsheet is filled in....but then I also need to unhide rows 60-63 if any of the following conditions are met:
Cell B36=True
Cell B46=True
Cell N27="CE"
Cell E28 ="Hrly" And Cell N28 "Ex"
In all other cases not mentioned above, rows 60-63 should remain hidden. Does anyone know how to write a code for something like that? I started to write down some lines below but couldn't figure out how to correctly integrate the N27 piece. I'm fairly new to the VBA syntax.
If Range("N27").Value <> "" Then
Range("60:61").EntireRow.Hidden = False
ElseIf Range("B36").Value = True Or Range("B46").Value = True Or Range("N27").Value = "CE" Or Range("E28").Value = "Hrly" And Range("N28").Value = "Ex" Then
Range("60:63").EntireRow.Hidden = False
Else: Range("60:63").EntireRow.Hidden = True