Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Selecting all sheets

I need a piece of VBA code that will select all visible sheets.

Just a slightly different technique:

Function SelectAllSheets()
'// Dana DeLouis
Dim sht As Variant

On Error Resume Next
For Each sht In Sheets
sht.Select Not sht.Visible
Next
'Return a count
SelectAllSheets = ActiveWindow.SelectedSheets.Count
End Function

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Erin" wrote in message
...
I need a piece of VBA code that will select all visible sheets. When I

record a macro, it does it via an array and specifying each sheet name.
But, in my case I don't know how many sheets there are.


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
Selecting sheets - II Dr.Schwartz Excel Discussion (Misc queries) 4 July 25th 05 02:31 PM
Selecting sheets without specifying abxy[_47_] Excel Programming 1 April 8th 04 12:51 AM
selecting sheets in vb peterG Excel Programming 6 January 15th 04 10:11 AM
Changing the value in multiple sheets without selecting those sheets herm Excel Programming 3 October 14th 03 03:50 PM
selecting sheets jacqui[_2_] Excel Programming 0 September 11th 03 02:46 PM


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

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"