ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Visible Sheet Showing When Hidden (https://www.excelbanter.com/excel-programming/293692-visible-sheet-showing-when-hidden.html)

Rockee052[_63_]

Visible Sheet Showing When Hidden
 
Hi,

I have some code for a listbox in a userform. Some of my sheets are se
to very hidden and with the code I have it's supposed to show just th
visible sheets. I have eight sheets that I dont want the users to hav
access to they are just used for coding purposes. But for some reaso
they show in the list box.

Thanks for any help or suggestions

Private Sub UserForm_Initialize()
Dim i As Long
With Me.ListBox1
.Clear
.MultiSelect = fmMultiSelectMulti
.ListStyle = fmListStyleOption
For i = 1 To ActiveWorkbook.Sheets.Count
If ActiveWorkbook.Sheets(i).Visible Then
.AddItem ActiveWorkbook.Sheets(i).Name
End If
Next
End With
End Sub

Rockee :confused

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



All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com