A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
I have uploaded a workbook that will export the worksheet without the VBA code. (Link below).
I have renamed this workbook so that the name of the workbook with the VBA code is significantly different from the workbooks without the code otherwise it will create confusion. You can re-name it again to anything you like but you will need to edit the code at the following line to reflect the new name in the Sub btnRotateShifts_Click()
strNewFileName = "VBA Code for Resources " & Format(dteWk, "dd-mmm-yy") & ".xls"
I have had to change the code workbook a bit and move the code to a standard module because if a worksheet is exported, any code in its VBA module gets automatically exported with it. When the code is in a standard module, the worksheet can be exported without the code.
I have reduced the workbook to just one sheet. The buttons to run the code are now Forms controls which are created from the forms Toolbar. Should not make any difference to you.
To see the VBA code use Alt/F11. If the code is not displayed then double click Module1 in the Project Explorer in the left column.
Click the button to rotate the shifts first. (The workbook with the code is automatically saved after the rotation). Then click the button to export the worksheet. When the sheet is exported, the new workbook is saved and a MsgBox telling you that it is the workbook for distribution. After you click OK to the message, the workbook with the code is automatically closed and the new workbook is left displayed.
File deleted. See later post for new file upload