View Single Post
  #7   Report Post  
Old August 28th 05, 06:44 PM
Dave Peterson
Posts: n/a

Do you take the data from each row, populate the other worksheet, then print,
then get the next row and repeat?

If yes, then maybe selecting all the rows you want to use makes more sense??

And I made some assumptions--sheet names, cell addresses and the like:

Option Explicit
Sub testme()
Dim prtWks As Worksheet
Dim actWks As Worksheet
Dim myRng As Range
Dim myCell As Range
Dim iRow As Long

Set actWks = ActiveSheet
Set prtWks = Worksheets("Sheet2")

Set myRng = Intersect(Selection.EntireRow, actWks.Range("a:a"))

With prtWks
For Each myCell In myRng.Cells
iRow = myCell.Row
.Range("a1").Value = actWks.Cells(iRow, "b").Value
.Range("c99").Value = actWks.Cells(iRow, "x").Value
.Range("b3").Value = actWks.Cells(iRow, "C").Value
.Range("d4").Value = actWks.Cells(iRow, "A").Value
.PrintOut preview:=True
Next myCell
End With
End Sub

I put the info in column B into A1
X into C99
C into B3
A into D4

I also called the sheet to be printed Sheet2.

Change those things and test it out.

When/if you're happy, get rid of the preview:=true portion. (That's just to
save some trees!)

Optitron wrote:

OK, I froze the button. Now how do I modify the macro? I'm trying to
program this sheet so that anyone can use it, even a Marine.

Optitron's Profile:
View this thread:


Dave Peterson