LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Looping thru the active selection

How can I loop through all the selected sheets in an Excel
workbook. I have a partial macro called Duplicate. Also I
have already created the form frmReplace and the function
ReplaceText. I want to be able to copy all the selected
sheets to just after the last sheet in the active
selection and rename them according to the ReplaceText
criteria.


Sub Duplicate()
Dim sht As Object
frmReplace.Show

**Somehow get the active selected sheets and
**copy to just after the end of the last selected sheet.
ActiveSheets.Copy After:= **no of the last selected sheet
For Each sht In **select the sheets that were just copied
sht.Name = ReplaceText(sht.Name, frmReplace.tbFind,
frmReplace.tbReplace)
Next sht
End Sub






 
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
Selection starting from active cell Ronald Dodge Excel Discussion (Misc queries) 3 October 10th 06 12:46 AM
Active range/selection? anita Excel Worksheet Functions 9 September 20th 06 01:35 PM
Looping a selection of rows Andre Kruger Excel Discussion (Misc queries) 1 December 15th 05 04:18 PM
Determining the Selection on a non-active Sheet? Jim S.[_4_] Excel Programming 2 April 17th 04 03:59 AM
Direction for looping through a Selection. Bob J. Excel Programming 2 September 16th 03 01:49 PM


All times are GMT +1. The time now is 02:35 AM.

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"