[newbie] Macro for "copy and paste"

J

Jon

I have an excel sheet which needs to copy values iteratively.

So for example, on sheet 2 I want to

1. copy value of sheet 1 > cell A1 to sheet 2 > cell A1
2. print it or send it to a print queue
3. clear the values from sheet 2 > cell A1
4. copy value of sheet 1 > cell A2 to sheet 2 > cell A1 (replace contents)

The above process would be repeated for a number of values that is displayed
within sheet 1 > cell A1.

Any ideas how to go about it?
 
J

Jacob Skaria

Dear Jon..........try this

Sub PrintSheet2()

Dim lngRow
Dim wrbMyBook

Set wrbMyBook = ActiveWorkbook
lngRow = 1

Do While wrbMyBook.Sheets("Sheet1").Range("A" & lngRow) <> ""
wrbMyBook.Sheets("Sheet2").Range("A1") =
wrbMyBook.Sheets("Sheet1").Range("A" & lngRow)
wrbMyBook.Sheets("Sheet2").PrintOut Copies:=1, Collate:=True
lngRow = lngRow + 1
Loop

End Sub

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top