![]() |
Printing 1 Form with differnt values ?
Hi there i have a workbook with the 1st sheet the actual form which we print out and the 2nd sheet is the database sheet with all the input information on it. is there a way of printing the form with the 2st set of data, then it will replace it with the 2nd set and print and so on. Hope you understand Many Thanks Benn -- cassy01 ------------------------------------------------------------------------ cassy01's Profile: http://www.excelforum.com/member.php...nfo&userid=780 View this thread: http://www.excelforum.com/showthread...hreadid=473713 |
You will need to have one cell that drives the entire form page, then use
VLOOKUP or SUMIF formulas to populate the form, based on that one cell (eg employee name, product number, cost center, etc.) Then create a list somewhere on the data page that includes all of the lookup items(eg all of your cost centers). Highlight this list, then go to "Insert", then "Name", then "Define"...give the list a name; let's call it "CC". Then go to "Tools", "Macro", "Visual Basic Editor" and type this in... Sub PrintFinancials() ' ' PrintFinancials Macro ' Macro recorded 9/25/2005 by JGReese ' Dim CostCenter As String For Each Name In Range("CC") ...this is your range name CostCenter = Name Sheets("FORM").Select ...this is the sheet where the data is to go Range("D5").Select ...this is the cell where the data is to go ActiveCell.FormulaR1C1 = CostCenter ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Next Name End Sub When you are done, save the file and close the visual basic editor. Add a button on you data page and assign the "Print Financials" macro to it. You should now be able to just click the button and the macro will put the first cost center on the form page, print it, then the second, print it... etc. to the bottom of you cost center list. "cassy01" wrote: Hi there i have a workbook with the 1st sheet the actual form which we print out and the 2nd sheet is the database sheet with all the input information on it. is there a way of printing the form with the 2st set of data, then it will replace it with the 2nd set and print and so on. Hope you understand Many Thanks Benn -- cassy01 ------------------------------------------------------------------------ cassy01's Profile: http://www.excelforum.com/member.php...nfo&userid=780 View this thread: http://www.excelforum.com/showthread...hreadid=473713 |
All times are GMT +1. The time now is 03:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com