G
Guest
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
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