View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Creating Print Macro

You can loop through the column with the "X" and copy the name to the input cell in Sheet1 and print

Something like this

A column have the names
B column the x

It will copy the value to A1 on sheet1 in this example and then print Sheet2

Sub test()
Dim cell As Range
For Each cell In Sheets("Sheet1").Columns("B").SpecialCells(xlCellT ypeConstants)
If LCase(cell.Value) = "x" Then
Sheets("Sheet1").Range("A1").Value = cell.Offset(0, -1).Value
Sheets("Sheet2").PrintOut
End If
Next cell
End Sub




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Confused" wrote in message ...
I have two linked worksheets where in the first sheet is where I have over
100 employee data stored and in the second sheet, I have a specific template
that contains vlookup formulas that will populate the sheet based on one
input assumption. So if I input Joe Smith in the input cell in Sheet 1,
Sheet 2 will automatically fill in data related to Joe Smith.

Is it possible to create a macro where if there is an "x" next to the
employee data, that sheet 2 will automatically populate, then print employee
1 data, move to next cell marked with "X" and populate and print the next
employee data, and so forth?