Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 341
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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
Toolbar buttons to hide/unhide sheets Barb in MD Excel Discussion (Misc queries) 4 February 10th 10 01:46 AM
Hide Unhide Buttons Microsoft Communities[_2_] Excel Discussion (Misc queries) 4 December 26th 09 03:18 PM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Hide/Unhide Buttons kdog Excel Discussion (Misc queries) 2 October 12th 06 07:38 PM
i have rows missing on my spreadsheet but i cannot unhide them? Emma130176 Excel Discussion (Misc queries) 3 August 4th 05 12:53 AM


All times are GMT +1. The time now is 11:09 AM.

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"