Hello
I started using a Time Sheet template built by somebody else and I'm wondering if there's a way to improve the "printall" macro it contains.
Basically I have one sheet that lists the employee with information in 5 columns.
Name - Department -Title - TITLE coding - DEPT coding
The other sheet is an empty time sheet template.
When I type an employee name into my time sheet, the rest of the information updates (simple Vlookup formula).
The current macro allows me to print the time sheets for all employees on the list, with a simple keyboard shortcut (CTR + S, even though the macro says Ctrl+Q - see below).
However, the current macro is recorded such as there's one code per row, which means I need to copy and paste the code in VBA and change the range every time I add an employee on my list. And if I remove employee from the list, I also need to remove the corresponding code otherwise it will print a blank sheet.
So I would like to be able to set up my printing range as the entire column("A:A"), then tell it to print only the rows that are filled.
Here's the current code:
' SelectAll Macro
' Macro recorded 9/7/2007 by
'
' Keyboard Shortcut: Ctrl+q
'
Sheets("Employee List").Select
Range("A2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TimeSheet").Select
Range("B4").Select
ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Thank you in advance for suggesting a different code!
I started using a Time Sheet template built by somebody else and I'm wondering if there's a way to improve the "printall" macro it contains.
Basically I have one sheet that lists the employee with information in 5 columns.
Name - Department -Title - TITLE coding - DEPT coding
The other sheet is an empty time sheet template.
When I type an employee name into my time sheet, the rest of the information updates (simple Vlookup formula).
The current macro allows me to print the time sheets for all employees on the list, with a simple keyboard shortcut (CTR + S, even though the macro says Ctrl+Q - see below).
However, the current macro is recorded such as there's one code per row, which means I need to copy and paste the code in VBA and change the range every time I add an employee on my list. And if I remove employee from the list, I also need to remove the corresponding code otherwise it will print a blank sheet.
So I would like to be able to set up my printing range as the entire column("A:A"), then tell it to print only the rows that are filled.
Here's the current code:
' SelectAll Macro
' Macro recorded 9/7/2007 by
'
' Keyboard Shortcut: Ctrl+q
'
Sheets("Employee List").Select
Range("A2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TimeSheet").Select
Range("B4").Select
ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Thank you in advance for suggesting a different code!