Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default All Sheets Unhide and Select

Question 1:
We are missing the visual basic code for selecting all
sheets in the workbook without having specific names for
all the sheets.

Question 2:
We want to unhide all hidden sheets in the workbook
without specifying specific names of them with one line
of code. We have achieved this with for next already but
not with a specific code line.

For Each sh In Sheets
sh.Visible = True
Next sh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default All Sheets Unhide and Select

For your first question, use
Worksheets.Select

For your second question, you need to use the For Next loop. There isn't a
single line of code for unhiding all worksheets.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"Hande & Tolga" wrote in message
...
Question 1:
We are missing the visual basic code for selecting all
sheets in the workbook without having specific names for
all the sheets.

Question 2:
We want to unhide all hidden sheets in the workbook
without specifying specific names of them with one line
of code. We have achieved this with for next already but
not with a specific code line.

For Each sh In Sheets
sh.Visible = True
Next sh




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default All Sheets Unhide and Select

Sub Q1()

Dim wsArray() As String
Dim ws As Worksheet
Dim index As Long

ReDim wsArray(1 To Worksheets.Count)

For index = 1 To Worksheets.Count

wsArray(index) = Worksheets(index).Name

Next

Sheets(wsArray).Select
Sheets("Sheet6").Activate
End Sub

Sub Q2()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Visible = xlSheetVisible
Next
End Sub


Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Question 1:
We are missing the visual basic code for selecting all
sheets in the workbook without having specific names for
all the sheets.

Question 2:
We want to unhide all hidden sheets in the workbook
without specifying specific names of them with one line
of code. We have achieved this with for next already

but
not with a specific code line.

For Each sh In Sheets
sh.Visible = True
Next sh


.

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
Select Option button unhide row Wanna Learn Excel Discussion (Misc queries) 5 March 7th 08 06:38 PM
Using Hide, Unhide, and auto filter - select all on a protected sh Pattie Excel Worksheet Functions 1 July 7th 06 04:47 PM
Unhide hidden sheets Minos Excel Discussion (Misc queries) 1 November 25th 05 05:07 PM
How to Unhide sheets pwermuth Excel Discussion (Misc queries) 4 July 15th 05 11:43 PM
How do I unhide multiple sheets? ahonig Excel Worksheet Functions 3 December 14th 04 09:03 PM


All times are GMT +1. The time now is 07:12 PM.

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"