View Single Post
  #10   Report Post  
Old August 28th 05, 08:43 PM
Optitron
 
Posts: n/a
Default


I copied everything and changed "sheet2" to what it was and the B, X, C,
and A back to what they were and I get an error. When I leave B, X, C,
and A the same I get a print preview of the form but it doesn't have
the info.


Dave Peterson Wrote:
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
Application.Calculate
.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

------------------------------------------------------------------------
Optitron's Profile:

http://www.excelforum.com/member.php...o&userid=26729
View this thread:

http://www.excelforum.com/showthread...hreadid=399813

--

Dave Peterson



--
Optitron
------------------------------------------------------------------------
Optitron's Profile: http://www.excelforum.com/member.php...o&userid=26729
View this thread: http://www.excelforum.com/showthread...hreadid=399813