PC Review


Reply
Thread Tools Rate Thread

Copying of consecutive Rows and pasting it in a different location

 
 
shriil
Guest
Posts: n/a
 
      29th Jan 2008
Hi

I have 20 consecutive rows each having 12 values in 12 consecutive
columns in each row. Now i want to write a procedure where I shall be
copying each row and pasting it on a different row. one at a time.
After the procedure has run thru all the 20 rows, it stops.

For Ex. If I have the following Values, such as

Row 1: 4 30 45 23 34 48....... (20 columns)
Row 2: .......... (20 columns)
........
Row 20: ................(20 columns)

The procedure shall first copy entire Row 1 and paste it in Row 50
Then copy entire Row 2 and paste it in
Row 51
Then Copy entire Row 3 and paste it in
Row 52
.... and so on and so forth until Row 20 is pasted.

Pls Help

 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      29th Jan 2008
I think your description is a bit muddled - you talk about 12 columns,
but then in your example you cite 20 columns.

Is there a particular reason why you want to copy/paste one row at a
time?

All you need to do is click on the row identifier for row 1, hold down
the <shift> key and click on the row identifier for row 20, then
release <shift> - this will have highlighted all 20 rows.

Click <copy>, then click in cell A51 and press <enter> - all 20 rows
will have been copied in one operation.

Hope this helps.

Pete

On Jan 29, 5:38*pm, shriil <sanjib.lah...@gmail.com> wrote:
> Hi
>
> I have 20 consecutive rows each having 12 values in 12 consecutive
> columns in each row. Now i want to write a procedure where I shall be
> copying each row and pasting it on a different row. one at a time.
> After the procedure has run thru all the 20 rows, it stops.
>
> For Ex. If I have the following Values, such as
>
> Row 1: 4 30 45 23 34 48....... * * (20 columns)
> Row 2: .......... (20 columns)
> .......
> Row 20: ................(20 columns)
>
> The procedure shall first copy entire Row 1 and paste it in Row 50
> * * * * * * * * * * * * * * * *Then copy entire Row 2 and paste it in
> Row 51
> * * * * * * * * * * * * * * * *Then Copy entire Row 3 and paste it in
> Row 52
> ... and so on and so forth until Row 20 is pasted.
>
> Pls Help


 
Reply With Quote
 
shriil
Guest
Posts: n/a
 
      30th Jan 2008
On Jan 29, 10:45*pm, Pete_UK <pashu...@auditel.net> wrote:
> I think your description is a bit muddled - you talk about 12 columns,
> but then in your example you cite 20 columns.
>
> Is there a particular reason why you want to copy/paste one row at a
> time?
>
> All you need to do is click on the row identifier for row 1, hold down
> the <shift> key and click on the row identifier for row 20, then
> release <shift> - this will have highlighted all 20 rows.
>
> Click <copy>, then click in cell A51 and press <enter> - all 20 rows
> will have been copied in one operation.
>
> Hope this helps.
>
> Pete
>
> On Jan 29, 5:38*pm, shriil <sanjib.lah...@gmail.com> wrote:
>
>
>
> > Hi

>
> > I have 20 consecutive rows each having 12 values in 12 consecutive
> > columns in each row. Now i want to write a procedure where I shall be
> > copying each row and pasting it on a different row. one at a time.
> > After the procedure has run thru all the 20 rows, it stops.

>
> > For Ex. If I have the following Values, such as

>
> > Row 1: 4 30 45 23 34 48....... * * (20 columns)
> > Row 2: .......... (20 columns)
> > .......
> > Row 20: ................(20 columns)

>
> > The procedure shall first copy entire Row 1 and paste it in Row 50
> > * * * * * * * * * * * * * * * *Then copyentire Row 2 and paste it in
> > Row 51
> > * * * * * * * * * * * * * * * *Then Copyentire Row 3 and paste it in
> > Row 52
> > ... and so on and so forth until Row 20 is pasted.

>
> > Pls Help- Hide quoted text -

>
> - Show quoted text -


Sorry. I made a mistake. Each row has 12 columns and not 20 columns. I
am aware of the method you have described. What I want is how to write
a procedure in the VB Editor such that the following operation
(detailed below) can be done at one go.

Say I have data in each of 12 columns of 20 Consecutive Rows. Ex. From
Rows 23 to 42, Columns D to O
Additionally I have data in Row 7, Column D to O.

Now I have to Copy each of the 20 Rows, one at a time, and paste it in
Row 8, Column D to O. The First operation occurs when Row 23 is
selected, copied and pasted on Row 8. Based upon the data pasted in
Row 8 along with that already resident in Row 7, a calculated value is
generated in Row 8, Column P (P8). The value in Cell (P8) is copied
and pasted in Row 9 Column A,i.e., Cell (A9).

In the second operation, Row 24 is selected, copied and pasted on Row
8. Based upon the changed data in Row 8, along with that resident in
Row 7, a calculated value is again generated in Row 8 Column P (P8).
Subsequently the new value in Cell (P8) is copied and pasted in Row 9
Column B,i.e., Cell (B9).

So for each of the 20 Rows pasted at the same location of Row 8, I
shall generate 20 calculated values that would be available from (A9)
to (T9). Depending upon the highest value among these cells, the Row
that was responsible for the same (i.e. one of the Rows between Rows
23 to 42), shall be permanently copied and pasted in Row 8 location.

I hope I have been able to explain it clearly. What I understand that
I have to write the code with a few Do.. While statements, but cannot
fathom how to denote which particular Row to be copied and pasted and
how to increment by one row at a time for the "Copy & Paste"
operation.

Pls Help


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying of consecutive Rows, one at a time and pasting it in onelocation shriil Microsoft Excel Programming 4 30th Jan 2008 03:41 PM
IF command and copying and pasting whole rows =?Utf-8?B?U2Nod2ltbXM=?= Microsoft Excel Misc 0 25th May 2007 08:00 PM
copying and pasting in exact location on other slides? Dave Leer Microsoft Powerpoint 5 15th Apr 2006 05:20 PM
Dynamic copying & pasting of rows =?Utf-8?B?Q2hyaXMgQnJvbWxleQ==?= Microsoft Excel Programming 7 8th Feb 2005 03:43 PM
copying and pasting rows josh ashcraft Microsoft Excel Misc 2 6th Aug 2003 05:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:48 AM.