Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Print single sheets from rows of data

I have a spreadsheet of 250 employees where annual increases are
calculated, lets call it sheet "A". I also have a separate sheet that
has cells for one employee's data so we can hand a sheet to each
employee, let's call it "B"
I want to be able to: 1)take the information from A 2) grab the
appropriate data from A for one employee 3) drop onto spreadhsheet B
4) print B 5) then repeat the process for each employee. 5) I also
want the code to ingnore rows that don't have a Y in field A or would
ingnore rows that don't have a value in a certain column. Has anyone
already done this? If so I would be most grateful for a VB code
sample.
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Print single sheets from rows of data

Hi John

If you use Vlookup formulas in the cells in Sheets("B") with as lookup value cell A1 of Sheets("B")
and a lookup table in Sheets("A") you can use this macro.

This will change the value of A1 in sheets("B") to the value of the cell in the B Column of sheets("A")
if there is a "Y" in the A Column.
(The B column have the employee names in them for example)

All the cells will be updated with the values of that row.
Print the Sheets("B") and change the value to the next value......

Sub test()
Dim cell As Range
For Each cell In Sheets("B").Cells.SpecialCells(xlCellTypeConstants )
'The B column have the employee names in them
If cell.Offset(-1, 0).Value = "Y" Then
Sheets("B").Range("A1").Value = cell.Value
Sheets("B").PrintOut
End If
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"John" wrote in message om...
I have a spreadsheet of 250 employees where annual increases are
calculated, lets call it sheet "A". I also have a separate sheet that
has cells for one employee's data so we can hand a sheet to each
employee, let's call it "B"
I want to be able to: 1)take the information from A 2) grab the
appropriate data from A for one employee 3) drop onto spreadhsheet B
4) print B 5) then repeat the process for each employee. 5) I also
want the code to ingnore rows that don't have a Y in field A or would
ingnore rows that don't have a value in a certain column. Has anyone
already done this? If so I would be most grateful for a VB code
sample.
John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Print single sheets from rows of data

Oops

Sorry

I am confused with your sheetnames<g
This will work

Sub test()
Dim cell As Range
For Each cell In Sheets("A").Columns("B").Cells.SpecialCells(xlCell TypeConstants)
If cell.Offset(0, -1).Value = "Y" Then
Sheets("B").Range("A1").Value = cell.Value
Sheets("B").PrintOut
End If
Next
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi John

If you use Vlookup formulas in the cells in Sheets("B") with as lookup value cell A1 of Sheets("B")
and a lookup table in Sheets("A") you can use this macro.

This will change the value of A1 in sheets("B") to the value of the cell in the B Column of sheets("A")
if there is a "Y" in the A Column.
(The B column have the employee names in them for example)

All the cells will be updated with the values of that row.
Print the Sheets("B") and change the value to the next value......

Sub test()
Dim cell As Range
For Each cell In Sheets("B").Cells.SpecialCells(xlCellTypeConstants )
'The B column have the employee names in them
If cell.Offset(-1, 0).Value = "Y" Then
Sheets("B").Range("A1").Value = cell.Value
Sheets("B").PrintOut
End If
Next
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"John" wrote in message om...
I have a spreadsheet of 250 employees where annual increases are
calculated, lets call it sheet "A". I also have a separate sheet that
has cells for one employee's data so we can hand a sheet to each
employee, let's call it "B"
I want to be able to: 1)take the information from A 2) grab the
appropriate data from A for one employee 3) drop onto spreadhsheet B
4) print B 5) then repeat the process for each employee. 5) I also
want the code to ingnore rows that don't have a Y in field A or would
ingnore rows that don't have a value in a certain column. Has anyone
already done this? If so I would be most grateful for a VB code
sample.
John





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Print single sheets from rows of data

Thanks much!
John
"Ron de Bruin" wrote in message ...
Oops

Sorry

I am confused with your sheetnames<g
This will work

Sub test()
Dim cell As Range
For Each cell In Sheets("A").Columns("B").Cells.SpecialCells(xlCell TypeConstants)
If cell.Offset(0, -1).Value = "Y" Then
Sheets("B").Range("A1").Value = cell.Value
Sheets("B").PrintOut
End If
Next
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



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
colating multi rows of data into single rows - no to pivot tables! UKMAN Excel Worksheet Functions 4 March 12th 10 04:11 PM
Moving data from multiple rows to single rows Pete Excel Worksheet Functions 5 February 16th 08 01:51 PM
Auto link rows of information from multiple sheets to single sheet Steve R Excel Discussion (Misc queries) 3 November 8th 06 06:13 AM
Multiple sheets as data for a single sheet Newbie1092 Excel Worksheet Functions 1 December 19th 05 05:20 PM
Set up a single page to print a chronolgy of sheets printed srfr808 Excel Discussion (Misc queries) 1 May 10th 05 10:28 AM


All times are GMT +1. The time now is 05:45 PM.

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

About Us

"It's about Microsoft Excel"