Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to do something similar. I would like to have rows 37 through 86
hidden and use a command button to unhide the next 5 rows each time it is clicked. For example, the first time the command button is clicked rows 37, 38, 39,40, and 41 are unhiden and 42 through 86 remain hiden. The second time the command button is clicked 42, 43, 44, 45. and 46 are unhiden and so on. Is it possible to click the button multiple times? "swatsp0p" wrote: For some reason, my post via Joseph Rubin's newsgroup did not make it to here. Assuming your worksheet is nameed "Sheet1" (edit as needed), create your button and add this code to your button: verify the columns listed match your desired ones to hide! ----------------------- Sub hidecolsrow4() ' hidecolsrow4 Macro If Worksheets("Sheet1").Columns("J").Hidden = False Then Range("J:J,L:L,N:N,P:P,R:R,T:T,V:V,X:X,Z:Z,AB:AB,A D:AD,AF :AF,AH:AH").Select Selection.EntireColumn.Hidden = True Range("A4").Activate Selection.EntireRow.Hidden = True ' unhidecolsrow4 Macro Else Rows("3:5").Select Selection.EntireRow.Hidden = False Columns("I:AI").Select Selection.EntireColumn.Hidden = False End If Range("A1").Select End Sub ---------------------------- If columns are hidden, this will Unhide them, if not hidden, it will Hide them. Good Luck __________________ Bruce The older I get, the better I used to be. Minneapolis, MN USA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to hide rows in a protected sheet | Excel Worksheet Functions | |||
Convert multiple columns to rows | Excel Worksheet Functions | |||
Unhide rows | Excel Discussion (Misc queries) | |||
interchange columns with rows | Excel Discussion (Misc queries) | |||
Checkbox to hide and unhide rows Please. | Excel Worksheet Functions |