Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Different Values & Printing.
I have two Excel sheets, the first is a data page, the
second is a form. The form picks up data from Sheet1 using vlookups based on a value that is typed in cell A6, the form is then printed. I would like to create a macro that will cycle through the list of values on the data sheet (the number of lines could vary) and then print each sheet before moving to the next value and printing. For example: Data sheet Name Age Gender Fred 20 M Tom 45 M Sally 31 F the form then reads the first cell Fred and puts it in cell A6 (the vlookups pick up the rest of the data), the form then prints. Then it picks up the second value Tom, puts it in A6 (again vlookups) and prints and so on until it gets to the end of the list which could be a blank cell or a particular word like "Total", i don't mind what this is, what ever is easiest for the macro. I really need some help, i'm stuck. Thanks Emma |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Different Values & Printing.
Hi Emma
This will change the value of A6 so all cells will be updated with the values . Print the Sheets("form") and change the value(a6) to the next value...... For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTyp eConstants) It will use all cells with a value in the A column on Sheets("data"). Sub test() Dim cell As Range For Each cell In Sheets("data").Columns("A").SpecialCells(xlCellTyp eConstants) Sheets("form").Range("A6").Value = cell.Value Sheets("form").PrintOut Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Emma Hope" wrote in message ... I have two Excel sheets, the first is a data page, the second is a form. The form picks up data from Sheet1 using vlookups based on a value that is typed in cell A6, the form is then printed. I would like to create a macro that will cycle through the list of values on the data sheet (the number of lines could vary) and then print each sheet before moving to the next value and printing. For example: Data sheet Name Age Gender Fred 20 M Tom 45 M Sally 31 F the form then reads the first cell Fred and puts it in cell A6 (the vlookups pick up the rest of the data), the form then prints. Then it picks up the second value Tom, puts it in A6 (again vlookups) and prints and so on until it gets to the end of the list which could be a blank cell or a particular word like "Total", i don't mind what this is, what ever is easiest for the macro. I really need some help, i'm stuck. Thanks Emma |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Printing Only Rows With Values In Them | Excel Worksheet Functions | |||
printing formula version and values togheter | New Users to Excel | |||
hiding individual cell values when printing | Excel Discussion (Misc queries) | |||
Printing 1 Form with differnt values ? | Excel Discussion (Misc queries) | |||
printing zero values | Excel Discussion (Misc queries) |