LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ListBox Procedures

Hello,

Today Bob has already helped me with this code (Bob if you are readin
this THANK YOU). I am having a little problem, if the user unhides th
worksheets then closes the user form. Then the user reopens th
userform and tries to hide the worksheets it does not work. Can anyon
see what I am missing...

Sub cmdUnhide_Click()
Dim sh As Worksheet
Dim i As Long
Dim c

Application.ScreenUpdating = False
If collSheets Is Nothing Then
Set collSheets = New Collection
Else
For i = 1 To collSheets.Count
collSheets.Remove 1
Next
End If
For Each sh In ActiveWorkbook.Sheets
If sh.Visible < xlSheetVisible Then
collSheets.Add sh.Index, sh.Name
sh.Visible = True
End If
Next sh
Application.ScreenUpdating = True
End Sub

Sub cmdHide_Click()
Dim sh As Worksheet
Dim i As Long

Application.ScreenUpdating = False
If collSheets Is Nothing Then
MsgBox "Error" 'I think something belongs here?
Else
For i = 1 To collSheets.Count
Worksheets(collSheets(i)).Visible = False
Next i
End If
Application.ScreenUpdating = True
End Sub

Thanks again,

Rockee
Excel 200

--
Message posted from http://www.ExcelForum.com

 
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
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Sequential Sub Procedures Roger[_10_] Excel Programming 3 November 20th 03 04:32 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
what's wrong with this sub procedures? active_x[_4_] Excel Programming 8 September 10th 03 05:25 AM


All times are GMT +1. The time now is 07:19 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"