Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I hide rows in Excel, using VBA, upon an event, like a click in a
control? THANKS! andrew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure how or what your wanting to hide but maybe this will get you
started. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) < "" Then ActiveCell.EntireRow.Hidden = True End If End Sub What the above code will do is if cell A1 is not blank then for each cell you click on it will hide the row. HTH "Andrew Appel" wrote in message ... How can I hide rows in Excel, using VBA, upon an event, like a click in a control? THANKS! andrew |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! This is a good start. I'm actually trying to hide a set of rows
on a sheet when I click in a control on different sheet. Is that doable? "Cliff Myers" wrote in message ... I'm not sure how or what your wanting to hide but maybe this will get you started. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) < "" Then ActiveCell.EntireRow.Hidden = True End If End Sub What the above code will do is if cell A1 is not blank then for each cell you click on it will hide the row. HTH "Andrew Appel" wrote in message ... How can I hide rows in Excel, using VBA, upon an event, like a click in a control? THANKS! andrew |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you mean a button on Sheet1
you can use this Macro for example Sub test() Sheets("Sheet2").Rows("3:10").Hidden = True End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Andrew Appel" wrote in message ... Thanks! This is a good start. I'm actually trying to hide a set of rows on a sheet when I click in a control on different sheet. Is that doable? "Cliff Myers" wrote in message ... I'm not sure how or what your wanting to hide but maybe this will get you started. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) < "" Then ActiveCell.EntireRow.Hidden = True End If End Sub What the above code will do is if cell A1 is not blank then for each cell you click on it will hide the row. HTH "Andrew Appel" wrote in message ... How can I hide rows in Excel, using VBA, upon an event, like a click in a control? THANKS! andrew |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect. Thanks!
andrew "Ron de Bruin" wrote in message ... If you mean a button on Sheet1 you can use this Macro for example Sub test() Sheets("Sheet2").Rows("3:10").Hidden = True End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Andrew Appel" wrote in message ... Thanks! This is a good start. I'm actually trying to hide a set of rows on a sheet when I click in a control on different sheet. Is that doable? "Cliff Myers" wrote in message ... I'm not sure how or what your wanting to hide but maybe this will get you started. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) < "" Then ActiveCell.EntireRow.Hidden = True End If End Sub What the above code will do is if cell A1 is not blank then for each cell you click on it will hide the row. HTH "Andrew Appel" wrote in message ... How can I hide rows in Excel, using VBA, upon an event, like a click in a control? THANKS! andrew |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! Perfect!
"Ron de Bruin" wrote in message ... If you mean a button on Sheet1 you can use this Macro for example Sub test() Sheets("Sheet2").Rows("3:10").Hidden = True End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Andrew Appel" wrote in message ... Thanks! This is a good start. I'm actually trying to hide a set of rows on a sheet when I click in a control on different sheet. Is that doable? "Cliff Myers" wrote in message ... I'm not sure how or what your wanting to hide but maybe this will get you started. Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Cells(1, 1) < "" Then ActiveCell.EntireRow.Hidden = True End If End Sub What the above code will do is if cell A1 is not blank then for each cell you click on it will hide the row. HTH "Andrew Appel" wrote in message ... How can I hide rows in Excel, using VBA, upon an event, like a click in a control? THANKS! andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
Hiding Specific Rows Based on Values in Other Rows | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) | |||
Copying Rows when hiding other rows | Excel Worksheet Functions |