View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Unhiding rows based on another cell value

Put this code in the worksheet code module. Right click the Sheet tab and
select View Code from the drop down menu. Copy this and paste into the code
window.

Private Sub Worksheet_Change()
Rows(28 & ":" & 29).Hidden = True
If Range("H37") = "True" Then
Rows(28).Hidden = False
ElseIf Range("H37") = "False" Then
Rows(6).Hidden = False
End If
End Sub

"Jumbo Jock" wrote:

Help required please!

Based on the value I return in cell H37 in a worksheet called "Promotion
Form", I need to be able to unhide a specifc row. So, to be exact....

if cell H37 = TRUE, I want row 28 to unhide (but row 29 which is also hidden
should remain hidden)
if cell H37 = FALSE, I want row 29 to unhide (but row 28 should remain hidden)
if cell H37 is blank, I want rows 28 and 29 to remain hidden.

I have tried writing various bits of code but have had no success.

Can anybody help me?

Many thanks