Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
hiding zero for a sum | Excel Discussion (Misc queries) | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding #N/A | Excel Discussion (Misc queries) | |||
Hiding #N/A | Excel Worksheet Functions | |||
Hiding #N/A | Excel Programming |