Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Hiding A Row

Hello.

I am trying to hide a row based on a value in a cell within the row. I
need this to take place as the sheet re-calculates after a different
selection is made from the Forms combo-box.

Not sure why I'm having issues, as this should be pretty
straightforward.

Any help would be greatly appreciated.

Thanks.

Dan

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Hiding A Row

Dan,

I'm not sure if you need to reference multiple rows or if it would always be
the same row that would be hidden. However, you could try something like
this.
This is based of the cell contents of A20 being "q" in which row 20 would
automatically hide.

If Range("A20").Value = "q" Then Rows(20).EntireRow.Hidden = True Else
Rows(20).EntireRow.Hidden = False

For this to work automatically, right-click on the current worksheet at the
bottom and select View Code. Then click the drop-down to select Worksheet.
Then verify that the other drop-down is on SelectionChange.

HTH,
Paul

"Dan G." wrote in message
...
Hello.

I am trying to hide a row based on a value in a cell within the row. I
need this to take place as the sheet re-calculates after a different
selection is made from the Forms combo-box.

Not sure why I'm having issues, as this should be pretty
straightforward.

Any help would be greatly appreciated.

Thanks.

Dan

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hiding A Row

Dim cell as Range
rows.Hidden = False
for each cell in Range("C1:C200")
if cell.Value = 3 then
rows(cell.Row).Hidden = True
exit for
end if
Next

--
Regards,
Tom Ogilvy

"Dan G." wrote in message
...
Hello.

I am trying to hide a row based on a value in a cell within the row. I
need this to take place as the sheet re-calculates after a different
selection is made from the Forms combo-box.

Not sure why I'm having issues, as this should be pretty
straightforward.

Any help would be greatly appreciated.

Thanks.

Dan

*** Sent via Developersdex http://www.developersdex.com ***



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Hiding A Row


I understand the code, and either would suffice. The problem I have is
having it execute upon a change in the drop-down.

Currently values re-calculate on the sheet in a series of INDEX
formulas. If you activate another cell on the sheet it works fine. If
you only change the drop down box, and don't select another cell, the
code does not execute.

What do you recommend?


*** Sent via Developersdex http://www.developersdex.com ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Hiding A Row

You might try using the change event instead of the selection change event.

Of course some drop downs have their own events and the one to look for
would most likely be the exit event (or the change event but this one
activates each
time a single character is typed into the drop down)

--
steveB

Remove "AYN" from email to respond
"Dan G." wrote in message
...

I understand the code, and either would suffice. The problem I have is
having it execute upon a change in the drop-down.

Currently values re-calculate on the sheet in a series of INDEX
formulas. If you activate another cell on the sheet it works fine. If
you only change the drop down box, and don't select another cell, the
code does not execute.

What do you recommend?


*** Sent via Developersdex http://www.developersdex.com ***



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
hiding zero for a sum bb Excel Discussion (Misc queries) 3 April 20th 10 03:01 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding #N/A FP Novice Excel Discussion (Misc queries) 1 August 7th 06 09:49 PM
Hiding #N/A Mick Excel Worksheet Functions 4 December 1st 04 12:35 AM
Hiding #N/A jamie85[_8_] Excel Programming 5 February 3rd 04 01:15 PM


All times are GMT +1. The time now is 09:19 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"