#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 193
Default Creating Print Macro

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
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?

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
need a print macro to print only a certain number of pages Tonso Excel Discussion (Misc queries) 2 July 26th 06 06:03 PM
Creating a Print Button william4444 New Users to Excel 3 June 22nd 06 07:33 AM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM


All times are GMT +1. The time now is 09:10 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"