Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Looping only through selected sheets



"Mike H" wrote:

Hi,

Try this

Dim sh As Object
For Each sh In ActiveWindow.SelectedSheets
MsgBox sh.Name
'do things
Next

Mike

"Paul S" wrote:

What is the VBA code to loop through only the selected sheets in a workbook?
That is if I have a workbook contain sheets A, B, C, D, and E and if I have
selected multiple sheets, say A, B and E, how do I write code that will
perform operations only on those sheets (A, B, and E)?

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
Looping through selected worksheets and delete a range (e.g., A2:D15) [email protected] Excel Programming 1 October 10th 07 01:41 AM
Looping through selected charts Keith B Excel Programming 0 August 15th 07 07:08 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
looping through selected sheet tabs Gary Adamson[_2_] Excel Programming 4 December 7th 04 01:09 PM


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