I have a workbook that keeps track of employee times for a two week period then prints reports at the end of the two weeks.
Some days the employee works overtime and somedays has authorized time off by specific cause.
A timeoff sheet must be printed for each day Authorized TimeOff is recorded. But not for days no time off was recorded.
The reports are run every two week.
I have written the necessary script to print the overtime reports and Timeoff report for the days needed and skip the days not need.
This is a Report form blank. (can be used by different peoples)
I want to rename the workbook for each employee, (how many and their names change from time to time) so each employee has their own report to fill out and keep up with.
Within the script I've written there are conditional links, that is to say for example, if timeoff was recorded, change date on timeoff sheet and branch to printsheet script, if not go to next conditional check.
The problem is this branch command. Its branched by the name of the workbook, but if I change the name of the workbook to a specific employee name, that branch will not work.
In the example above "AA.Payroll Rpt Blank.xls'! would need to change to (for example) AA.Payroll Rpt James'!
I Tried
But that didn't work.
If the -'AA.Payroll Rpt Blank.xlsm'!- in the script could be a refferance example - 'Sheet("Data Input"),Range("A1")'! I would be able to write the workbook's name in cell A1 of the Sheet Data Input and would only have to change that one time for each employee.
The Application.Run branch is used several time in different scripts to branch to different scripts, but the workbook name is the same in all of them.
If this can be done, I hope someone know how.
Attached is the workbook, no data is included. I may not have completed all my work on the rest of the workbook, but trying to solve this one issue for now.
Thank you
Bookmarks