abenitez77
Registered User.
- Local time
- Today, 11:16
- Joined
- Apr 29, 2010
- Messages
- 141
I have 4 sheets in my workbook and I want to rename the existing 4 sheets and then make a copy of the 4 existing sheets.
I want to have 8 sheets:
2020
2020Rx
2019
2019Rx
2018
2018Rx
2017
2017Rx
This is the code I have so far and it creates the 8 sheets, but I want to create the new ones from copying the existing sheets as it has an image (jpg) that I want to carry over.
'''
'''
I want to have 8 sheets:
2020
2020Rx
2019
2019Rx
2018
2018Rx
2017
2017Rx
This is the code I have so far and it creates the 8 sheets, but I want to create the new ones from copying the existing sheets as it has an image (jpg) that I want to carry over.
'''
Code:
myshtname = "2020"
myshtnameRx = "2020Rx"
For each sheet In loBook.Worksheets
loBook.Worksheets(sheet.Name).Select
loBook.Worksheets(sheet.Name).Name = myshtname
set loWorksheetRx = loBook.Sheets.Add
loWorksheetRx.name = myshtnameRx
loWorkSheetRx.Activate
ix = ix + 1
myshtname = Left(Trim(nAuditdesc2),4) - ix
myshtnameRx = Left(Trim(nAuditdesc2), 4) - ix & "Rx"
Next Sheet