Print Macro Help

jmendenhall1960

New Member
Joined
Feb 14, 2012
Messages
41
I have a list of names (40) on Report sheet that I would like a macro to print starting at first name on Report sheet! A2 and place in cell B5 of certification sheet! then print the sheet next open Competency file Review sheet! then place the same name from Report sheet! A2 in cell B2 print the sheet then start all over with the name in the next row in Report sheet! cell A3 and place in cell B5 of certification sheet! then print the sheet then open Competency file Review sheet! then place the same name from Report sheet B2 in cell B2 (Competency file Review sheet!) print the sheet then start all over with next row (name) until no more names and end at the Report sheet!. The following is what I came up with when recording the macro but I know there is a shorter way (I just can't seem to figure it out). I only did two rows (names) and it is going to be a very long macro doing it my way. Thank you for looking and your help.:confused:

[Sub PrintCompetencyReport()
'
' PrintCompetencyReport Macro
' Prints Certification and Competency for each staff member
'
' Keyboard Shortcut: Ctrl+z
'
Sheets("Certification").Select
Range("B5").Select
ActiveCell.FormulaR1C1 = "=report!R[-3]C[-1]"
Range("B6").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Competency File Review ").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "=report!RC[-1]"
Range("B3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Certification").Select
Range("B5").Select
ActiveCell.FormulaR1C1 = "=report!R[-2]C[-1]"
Range("B6").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Competency File Review ").Select
Range("B2").Select
ActiveCell.FormulaR1C1 = "=report!R[1]C[-1]"
Range("B3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("report").Select
End Sub]
 
Last edited:

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
If I have read it right try the (untested) code below (are you sure about the space at the end of "Competency File Review " sheet?)

Code:
Sub testprint()
    Dim c As Range
    For Each c In Sheets("Reports").Range("A2:A" & Sheets("Reports").Range("A" & Rows.Count).End(xlUp).Row)
        c.Copy Sheets("Certification").Range("B5")
        c.Copy Sheets("Competency File Review ").Range("B2")
        Sheets(Array("Certification", "Competency File Review ")).PrintOut Copies:=1, Collate:=True
    Next
End Sub
 
Upvote 0
Actually as you probably only have to move values then the below should be more efficient.

Code:
Sub testprint()
    Dim c As Range
    For Each c In Sheets("Reports").Range("A2:A" & Sheets("Reports").Range("A" & Rows.Count).End(xlUp).Row)
        Sheets("Certification").Range("B5").Value = c.Value
        Sheets("Competency File Review ").Range("B2").Value = c.Value
        Sheets(Array("Certification", "Competency File Review ")).PrintOut Copies:=1, Collate:=True
    Next
    Sheets("Reports").Activate
End Sub
 
Upvote 0
Actually as you probably only have to move values then the below should be more efficient.

Code:
Sub testprint()
    Dim c As Range
    For Each c In Sheets("Reports").Range("A2:A" & Sheets("Reports").Range("A" & Rows.Count).End(xlUp).Row)
        Sheets("Certification").Range("B5").Value = c.Value
        Sheets("Competency File Review ").Range("B2").Value = c.Value
        Sheets(Array("Certification", "Competency File Review ")).PrintOut Copies:=1, Collate:=True
    Next
    Sheets("Reports").Activate
End Sub

Works great and thank you again. Saves me alot of time and I can't forget anyone this way.:eek::p
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top