Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to hide rows?
Hello,
If possible, I would like a simple button to hide & show a set number of rows (rows 5 - 35). Can this be done? Thanks -SD |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to hide rows?
Hi S Davis
Rows(5 & ":" & 35).Hidden = True -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "S Davis" wrote in message oups.com... Hello, If possible, I would like a simple button to hide & show a set number of rows (rows 5 - 35). Can this be done? Thanks -SD |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to hide rows?
Thanks, thats great :) Works perfect. Is there anything more elegant than the following for what I would like to do? Id like to avoid the 'stepladder' visual that occurs when trying to hide various rows. ShowRows() essentially shows everything and then hides the ones I dont want seen. Id prefer to do something like Rows(8 & 10 & 12......).Hidden = False but this is not accepted. Ex (my code) Sub HideRows() Rows(5 & ":" & 42).Hidden = True End Sub Sub ShowRows() Rows(1 & ":" & 42).Hidden = False Rows(8).Hidden = True Rows(10).Hidden = True Rows(12).Hidden = True Rows(14).Hidden = True Rows(16).Hidden = True Rows(18).Hidden = True Rows(20).Hidden = True Rows(22).Hidden = True Rows(27).Hidden = True Rows(29).Hidden = True Rows(35).Hidden = True Rows(37).Hidden = True Rows(39).Hidden = True Rows(41).Hidden = True Rows(42).Hidden = True End Sub Thanks -SD On Jan 24, 12:32 pm, "Ron de Bruin" wrote: Hi S Davis Rows(5 & ":" & 35).Hidden = True -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "S Davis" wrote in ooglegroups.com... Hello, If possible, I would like a simple button to hide & show a set number of rows (rows 5 - 35). Can this be done? Thanks -SD- Hide quoted text -- Show quoted text - |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to hide rows?
You can use this
Range("A8,A10,a12").EntireRow.Hidden = True -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "S Davis" wrote in message ups.com... Thanks, thats great :) Works perfect. Is there anything more elegant than the following for what I would like to do? Id like to avoid the 'stepladder' visual that occurs when trying to hide various rows. ShowRows() essentially shows everything and then hides the ones I dont want seen. Id prefer to do something like Rows(8 & 10 & 12......).Hidden = False but this is not accepted. Ex (my code) Sub HideRows() Rows(5 & ":" & 42).Hidden = True End Sub Sub ShowRows() Rows(1 & ":" & 42).Hidden = False Rows(8).Hidden = True Rows(10).Hidden = True Rows(12).Hidden = True Rows(14).Hidden = True Rows(16).Hidden = True Rows(18).Hidden = True Rows(20).Hidden = True Rows(22).Hidden = True Rows(27).Hidden = True Rows(29).Hidden = True Rows(35).Hidden = True Rows(37).Hidden = True Rows(39).Hidden = True Rows(41).Hidden = True Rows(42).Hidden = True End Sub Thanks -SD On Jan 24, 12:32 pm, "Ron de Bruin" wrote: Hi S Davis Rows(5 & ":" & 35).Hidden = True -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "S Davis" wrote in ooglegroups.com... Hello, If possible, I would like a simple button to hide & show a set number of rows (rows 5 - 35). Can this be done? Thanks -SD- Hide quoted text -- Show quoted text - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to hide rows?
Fantastic Ron, thanks again!
On Jan 24, 1:39 pm, "Ron de Bruin" wrote: You can use this Range("A8,A10,a12").EntireRow.Hidden = True -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "S Davis" wrote in oglegroups.com... Thanks, thats great :) Works perfect. Is there anything more elegant than the following for what I would like to do? Id like to avoid the 'stepladder' visual that occurs when trying to hide various rows. ShowRows() essentially shows everything and then hides the ones I dont want seen. Id prefer to do something like Rows(8 & 10 & 12......).Hidden = False but this is not accepted. Ex (my code) Sub HideRows() Rows(5 & ":" & 42).Hidden = True End Sub Sub ShowRows() Rows(1 & ":" & 42).Hidden = False Rows(8).Hidden = True Rows(10).Hidden = True Rows(12).Hidden = True Rows(14).Hidden = True Rows(16).Hidden = True Rows(18).Hidden = True Rows(20).Hidden = True Rows(22).Hidden = True Rows(27).Hidden = True Rows(29).Hidden = True Rows(35).Hidden = True Rows(37).Hidden = True Rows(39).Hidden = True Rows(41).Hidden = True Rows(42).Hidden = True End Sub Thanks -SD On Jan 24, 12:32 pm, "Ron de Bruin" wrote: Hi S Davis Rows(5 & ":" & 35).Hidden = True -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "S Davis" wrote in ooglegroups.com... Hello, If possible, I would like a simple button to hide & show a set number of rows (rows 5 - 35). Can this be done? Thanks -SD- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Group rows (or hide rows) like in MS Project | Excel Worksheet Functions | |||
Macro code to hide rows and not calculate hidden rows | Excel Discussion (Misc queries) | |||
Enabling option „Format rows“ to hide/unhide rows using VBA-code? | Excel Discussion (Misc queries) | |||
cut rows without cutting hide rows | Excel Discussion (Misc queries) | |||
Hide Rows - copy and paste only rows that show | Excel Worksheet Functions |