LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Copying of consecutive Rows, one at a time and pasting it in onelocation

On Jan 30, 4:15*pm, "Per Jessen" wrote:
Hi Per


Thanks a Ton. Your code worked perfectly ok. only the last bit,
i.e. ....


For Each c In Range("A9:T9")
* * If c.Value testval Then
* * * * testval = c.Value
* * * ColOff = counter
* *End If
* *counter = counter + 1
Next
Range("D23:O23").Offset(ColOff - 1, 0).Copy Destination:=Range(DestRange)


..... i guess didnt work. Because finally depending upon the highest
value in A9:T9, the particular Row in the Range (D23:O42) gets copied
to Destination Range "D8". Am i right in understanding your code?..
But the final copying did not take place.


Could you please explain the above part of the code?


What is the initial value of 'testval'. Is that the highest value in
the Range A9:T9?


Thanks again for putting me on track


Hi again

Thanks for your reply.

The initial value of 'testval' is 0. After the loop it should be equal to
the highest value it the target range.

'ColOff' is the number of rows to offset. I.e pointing to the row to be
copied.

My mistake. Change the last line to this, and it should work for you :-)

Range("D23:O23").Offset(ColOff, 0).Copy Destination:=Range(DestRange)

Regards,

Per- Hide quoted text -

- Show quoted text -


Hi Per

Got it. It works perfectly now. Thanks again



 
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
IF command and copying and pasting whole rows Schwimms Excel Discussion (Misc queries) 0 May 25th 07 08:00 PM
Copying and Pasting Rows Macro tnederlof Excel Discussion (Misc queries) 1 February 2nd 07 05:23 PM
Prevent user from copying pasting at run time sanjeet Excel Programming 0 September 23rd 06 11:27 PM
copying and pasting with hidden rows arcticale Excel Discussion (Misc queries) 2 December 29th 05 10:46 PM
Dynamic copying & pasting of rows Chris Bromley Excel Programming 7 February 8th 05 03:43 PM


All times are GMT +1. The time now is 01:19 PM.

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

About Us

"It's about Microsoft Excel"