Create Printing Macro
I have a workbook containing two worksheets. The first, is structured like a table, the second, like a form with about 20+ cell references to the first worksheet. I would like to create a macro that will print a "form" for each row (200+) in the "table". Thanks
|
Create Printing Macro
Hi
One way If you add Vlookup formulas in the 20 cells in Sheets("form") with as lookup value cell A1 Sheets("form") and a lookup table in Sheets("table") you can use this macro. This will change the value of A1 so all 20 cells will be updated with the values of that row. Print the Sheets("form") and change the value to the next value...... Sub test() Dim cell As Range For Each cell In Sheets("table").Range("a1:a200") Sheets("form").Range("A1").Value = cell.Value Sheets("form").PrintOut Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "mvent" wrote in message ... I have a workbook containing two worksheets. The first, is structured like a table, the second, like a form with about 20+ cell references to the first worksheet. I would like to create a macro that will print a "form" for each row (200+) in the "table". Thanks |
Create Printing Macro
-----Original Message----- Hi One way If you add Vlookup formulas in the 20 cells in Sheets ("form") with as lookup value cell A1 Sheets("form") and a lookup table in Sheets("table") you can use this macro. This will change the value of A1 so all 20 cells will be updated with the values of that row. Print the Sheets("form") and change the value to the next value...... Sub test() Dim cell As Range For Each cell In Sheets("table").Range("a1:a200") Sheets("form").Range("A1").Value = cell.Value Sheets("form").PrintOut Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "mvent" wrote in message news:5FC1BBA9-40B3-4BBF-9A87- ... I have a workbook containing two worksheets. The first, is structured like a table, the second, like a form with about 20+ cell references to the first worksheet. I would like to create a macro that will print a "form" for each row (200+) in the "table". Thanks . Thanks, It worked great!! |
All times are GMT +1. The time now is 09:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com