Create Printing Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)




mvent said:
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
 
-----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)




"mvent" <[email protected]> wrote in
message (e-mail address removed)...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
 
Back
Top