![]() |
I am missing something (hide / unhide rows with buttons)
There it is again: This one to hide rows with "info" in column B: Dim cell As Range For Each cell In Range("B:B") If cell = "i" Then Rows(cell.Row).Hidden = True Next (Work fine...) And this one to show them back: Rows("1:100").Select Selection.EntireRow.Hidden = False However, the "show all" button doesn't work once I hit the "hide info" button... Please help! Can any1 tell me why? -- Turquoise_dax ------------------------------------------------------------------------ Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185 View this thread: http://www.excelforum.com/showthread...hreadid=553691 |
I am missing something (hide / unhide rows with buttons)
I think that in your Unhide part, Excel cannot select the rows that are
already hidden. You really want to avoid selecting things because it slows everything down. Why don't you just use exactly the same code but make them unhidden instead: Sub Unhide() Dim cell As Range For Each cell In Range("B:B") If cell = "i" Then Rows(cell.Row).Hidden = False Next End sub Or try this if you just want the first 100 rows: Sub Unhide2() Dim iRow As integer For iRow = 1 to 100 Rows(iRow).Hidden = False Next iRow End sub -- Allllen "Turquoise_dax" wrote: There it is again: This one to hide rows with "info" in column B: Dim cell As Range For Each cell In Range("B:B") If cell = "i" Then Rows(cell.Row).Hidden = True Next (Work fine...) And this one to show them back: Rows("1:100").Select Selection.EntireRow.Hidden = False However, the "show all" button doesn't work once I hit the "hide info" button... Please help! Can any1 tell me why? -- Turquoise_dax ------------------------------------------------------------------------ Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185 View this thread: http://www.excelforum.com/showthread...hreadid=553691 |
I am missing something (hide / unhide rows with buttons)
Thanx: works wonders! -- Turquoise_dax ------------------------------------------------------------------------ Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185 View this thread: http://www.excelforum.com/showthread...hreadid=553691 |
All times are GMT +1. The time now is 06:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com