Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide/Unhide Sheets Form


Hi everyone, I'm trying to make a form with two listbox and fill the
with all sheets in a workbook (visible and hidden). See below the cod
in form_activate line:


Code
-------------------

Dim x As Integer
Dim vhojactiva As String

Application.ScreenUpdating = False
vhojactiva = ActiveSheet.Name

For x = 1 To Sheets.Count
Sheets(Array(x)).Select
If ActiveSheet.Visible = -1 Then
lstvisible.AddItem (ActiveSheet.Name)
Else
lsthidden.AddItem (ActiveSheet.Name)
End If
Next x
Sheets(vhojactiva).Select
Application.ScreenUpdating = True

-------------------


...the problem is when I try to select a hidden sheet. How can I do ?
Any idea is welcome.

Thanks and Regards
Daniel

--
dbarell
-----------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...fo&userid=3127
View this thread: http://www.excelforum.com/showthread.php?threadid=56701

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Hide/Unhide Sheets Form

Dim x As Integer

Application.ScreenUpdating = False

For x = 1 To Sheets.Count
If Sheets(x).Visible = xlSheetVisible Then
lstvisible.AddItem (ActiveSheet.Name)
Else
lsthidden.AddItem (ActiveSheet.Name)
End If
Next x

Application.ScreenUpdating = True


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"dbarelli" wrote in
message ...

Hi everyone, I'm trying to make a form with two listbox and fill them
with all sheets in a workbook (visible and hidden). See below the code
in form_activate line:


Code:
--------------------

Dim x As Integer
Dim vhojactiva As String

Application.ScreenUpdating = False
vhojactiva = ActiveSheet.Name

For x = 1 To Sheets.Count
Sheets(Array(x)).Select
If ActiveSheet.Visible = -1 Then
lstvisible.AddItem (ActiveSheet.Name)
Else
lsthidden.AddItem (ActiveSheet.Name)
End If
Next x
Sheets(vhojactiva).Select
Application.ScreenUpdating = True

--------------------


..the problem is when I try to select a hidden sheet. How can I do ?
Any idea is welcome.

Thanks and Regards
Daniel.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile:

http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=567019



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Hide/Unhide Sheets Form

there is no need to select the sheets (and no, you can't select a hidden sheet)

Dim x As Integer
Dim vhojactiva As String

vhojactiva = ActiveSheet.Name

For x = 1 To Sheets.Count
If sheets(x).Visible = -1 Then
lstvisible.AddItem sheets(x).Name
Else
lsthidden.AddItem sheets(x).Name
End If
Next x

--
Regards,
Tom Ogilvy


"dbarelli" wrote:


Hi everyone, I'm trying to make a form with two listbox and fill them
with all sheets in a workbook (visible and hidden). See below the code
in form_activate line:


Code:
--------------------

Dim x As Integer
Dim vhojactiva As String

Application.ScreenUpdating = False
vhojactiva = ActiveSheet.Name

For x = 1 To Sheets.Count
Sheets(Array(x)).Select
If ActiveSheet.Visible = -1 Then
lstvisible.AddItem (ActiveSheet.Name)
Else
lsthidden.AddItem (ActiveSheet.Name)
End If
Next x
Sheets(vhojactiva).Select
Application.ScreenUpdating = True

--------------------


...the problem is when I try to select a hidden sheet. How can I do ?
Any idea is welcome.

Thanks and Regards
Daniel.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=567019


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide/Unhide Sheets Form


Many Thanks to all !!
Daniel.


--
dbarelli
------------------------------------------------------------------------
dbarelli's Profile: http://www.excelforum.com/member.php...o&userid=31275
View this thread: http://www.excelforum.com/showthread...hreadid=567019

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
Hide/Unhide Sheets Runner77[_4_] Excel Programming 2 January 16th 06 09:19 AM
Hide/Unhide sheets ali Excel Programming 1 January 30th 04 10:06 PM
Hide/Unhide sheets [email protected] Excel Programming 4 January 5th 04 03:32 AM
Password to hide and unhide sheets Veera Excel Programming 2 July 23rd 03 04:23 PM
Password to hide and unhide sheets Patrick Molloy Excel Programming 0 July 23rd 03 04:04 PM


All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"