Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VBA - hiding rows

How can I hide rows in Excel, using VBA, upon an event, like a click in a
control?
THANKS!
andrew


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default VBA - hiding rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VBA - hiding rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VBA - hiding rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VBA - hiding rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VBA - hiding rows

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
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
Color alternate rows when after hiding selected rows Monk[_2_] Excel Worksheet Functions 6 June 7th 08 01:36 AM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM


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

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

About Us

"It's about Microsoft Excel"