PDA

View Full Version : Solved: Print information from rows



parttime_guy
05-14-2008, 07:53 PM
Hi,
I have 2 worksheets

Sheet1: Data (all information in rows) maybe 15 colums
Row 1 of Sheet1 consists of a header giving the description of the column
Row 2 of Sheet1 consist the data that has to be linked into Sheet2: The Form that has to printed
Row 3 of Sheet1 till the end consist of final data

Sheet2: The Form that has to be printed
This has links to Row 2 of Sheet1 and the data is displayed on various parts of the Form

Problem
Please help with a macro:
Information on Row 3 of Sheet1 should be copied and pasted in Row 2 of Sheet1 and the Form should be printed (the Macro should continue to print all rows available till the end).

Thx-n-BR
: pray2:

Bob Phillips
05-15-2008, 12:29 AM
Public Sub ProcessData()
Dim LastRow As Long
Dim i As Long

With Worksheets("Data")

LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 2 To LastRow

Worksheets("Form").PrintOut
.Rows(2).Copy .Rows(LastRow + 1)
.Rows(3).Resize(LastRow - 2).Copy .Range("A2")
.Rows(LastRow).Delete
Next i
End With

End Sub

parttime_guy
05-15-2008, 01:37 AM
Dear XLD,

ur a Star!!!

Just works perfect.

Thx-n-BR
:thumb :friends: :beerchug: