Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selection starting from active cell | Excel Discussion (Misc queries) | |||
Active range/selection? | Excel Worksheet Functions | |||
Looping a selection of rows | Excel Discussion (Misc queries) | |||
Determining the Selection on a non-active Sheet? | Excel Programming | |||
Direction for looping through a Selection. | Excel Programming |