• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to Print all Forms

Big Bill

New Member
I know this will be easy for all the macros experts, but I am absolutely clueless on this. I would like to insert a macros button on the bottom of my form to print a unique form for each student (names have been changed to numbers for privacy reasons). I want to hit the button and have each field populated with the information in my LOOKUP and then print each form. I've included my workbook for reference.
 

Attachments

  • 5th Grade Data Team Meeting Summary Form - Fall 2014 (TEST).xlsx
    14.5 KB · Views: 2
Hi Big Bill,

Unless you use some code the best way to do this is to start recording a macro and step through the process as you would like it to happen until the printing has completed.

Once you have this done, draw a shape on the screen, add some text to label it. Then it is just a matter of right click, assign macro.
 
Copy of macro sheet.
 

Attachments

  • 5th Grade Data Team Meeting Summary Form - Fall 2014 (TEST).xlsm
    19.3 KB · Views: 7
Hello again Bill :)
If I remember, your previous sheet we looped through the list, changing values, and printing each sheet.
With your current setup, I'm unsure which part is the lookup. Or, is only the student name/number changing, and everything else remains the same?
I'm not sure if the "E" in AH1 or the "M" in AK1 mean anything.
 
Luke,

You are correct, I'm looking to loop through the list, changing names and values, just like last time.

I am attaching a different sheet from the one above, with more values to fill. I have the lookup part taken care of (thanks to your example from last time), it's the scrolling and printing macro I don't know how to do.

I am pulling values from AK, AL, AN, AO, AP, AQ, AR & AS via the lookup.

The E & M are just markers for me (ELA & Math). I also have the data from AT2 already populated without a lookup.

Any help would be greatly appreciated.

Thanks,
Bill
 

Attachments

  • TESTX.xlsx
    18.8 KB · Views: 6
Wonderful Bill, thanks for the info. This macro should do what you need. I tried to add some comments, in case you need to adapt this for other sheets as well. :)

Code:
Sub LoopAndPrint()
Dim StartRow As Long
Dim LastRow As Long
Dim myCounter As Long
Dim infoCol As String
Dim ChangeCell As Range

'====BEGIN INPUTS
'Which column is student info in?
infoCol = "AK"
'Which row do we start at?
StartRow = 2
'Which cell are we changing?
Set ChangeCell = Range("G1")
'====END INPUTS


'Finds the last row in column automatically
LastRow = Cells(StartRow, infoCol).End(xlDown).Row
For myCounter = StartRow To LastRow
    'Change cell value
    ChangeCell.Value = Cells(myCounter, infoCol).Value
    'Print the sheet
    ActiveSheet.PrintOut
Next myCounter

End Sub
 
Back
Top