Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Only Rows With Values In Them robzrob Excel Worksheet Functions 2 December 13th 09 06:58 PM
printing formula version and values togheter Carlos New Users to Excel 2 September 25th 06 10:01 PM
hiding individual cell values when printing Glen Excel Discussion (Misc queries) 7 July 26th 06 12:03 AM
Printing 1 Form with differnt values ? cassy01 Excel Discussion (Misc queries) 1 October 6th 05 05:39 PM
printing zero values dave glynn Excel Discussion (Misc queries) 1 January 31st 05 07:47 PM


All times are GMT +1. The time now is 06:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"