Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Unhiding rows based on another cell value

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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


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

this might work better. Forgot the declaration.

Private Sub Worksheet_Change(ByVal Target As Range)
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Unhiding rows based on another cell value

Hey Whiz-meister!

That was perfect - many thanks for your assistance!

:-)

"JLGWhiz" wrote:

this might work better. Forgot the declaration.

Private Sub Worksheet_Change(ByVal Target As Range)
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unhiding rows based on another cell value

Hi Guys,

I am trying to do the exact same thing in Excel 03 and have replicated the
above scenario exactly however nothing seems to be working. The rows are not
hidden and nothing happens when I change the value of cell H37. I've copied
and pasted the code into the relevant section as described by right clicking
the worksheet icon and 'view code' and have closed and re-opened the file
without success.

Does anyone have any suggestions or perhaps an alternative way to do this??

Thanks very much!

"Jumbo Jock" wrote:

Hey Whiz-meister!

That was perfect - many thanks for your assistance!

:-)

"JLGWhiz" wrote:

this might work better. Forgot the declaration.

Private Sub Worksheet_Change(ByVal Target As Range)
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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Unhiding rows based on another cell value

The code worked for me.

Are you sure you allowed macros to run?

If you add a line right at the top:

Private Sub Worksheet_Change(ByVal Target As Range)
msgbox "hi"
...

You can at least verify that the event is firing.

TLXL wrote:

Hi Guys,

I am trying to do the exact same thing in Excel 03 and have replicated the
above scenario exactly however nothing seems to be working. The rows are not
hidden and nothing happens when I change the value of cell H37. I've copied
and pasted the code into the relevant section as described by right clicking
the worksheet icon and 'view code' and have closed and re-opened the file
without success.

Does anyone have any suggestions or perhaps an alternative way to do this??

Thanks very much!

"Jumbo Jock" wrote:

Hey Whiz-meister!

That was perfect - many thanks for your assistance!

:-)

"JLGWhiz" wrote:

this might work better. Forgot the declaration.

Private Sub Worksheet_Change(ByVal Target As Range)
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



--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unhiding rows based on data input Janelle S[_2_] Excel Discussion (Misc queries) 2 November 8th 08 04:00 AM
Hiding / unhiding rows based on change of a cell jack[_2_] Excel Programming 8 November 18th 07 05:24 AM
Hiding/unhiding columns based on user selection Bob Excel Programming 8 August 15th 07 08:56 PM
Not unhiding rows when pointing to cell to complete formula entry Don Wiss Excel Programming 0 July 2nd 04 12:20 AM
Unhiding Rows Vasant Nanavati[_2_] Excel Programming 0 August 19th 03 12:54 AM


All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"