Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jon Jon is offline
external usenet poster
 
Posts: 183
Default [newbie] Macro for "copy and paste"

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?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default [newbie] Macro for "copy and paste"

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
---------------
Jacob Skaria


"Jon" wrote:

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?

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
how to copy a pivot table and "paste special" formats in excel 07 kswan Excel Discussion (Misc queries) 1 October 16th 07 01:27 PM
problem with Linking workbooks via "copy" and "paste link" Arkitek Excel Discussion (Misc queries) 0 December 19th 06 10:03 PM
Macro to find copy "header" and paste RunsWithKnives Excel Discussion (Misc queries) 3 March 27th 06 05:55 AM
Auto "copy and paste" individual cells from various sheets into one sheet ?? [email protected] Excel Discussion (Misc queries) 2 March 1st 06 03:19 AM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 10:23 AM.

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

About Us

"It's about Microsoft Excel"