+ Reply to Thread
Results 1 to 4 of 4

Copy and Paste Non-contiguous Range

  1. #1
    Registered User
    Join Date
    02-03-2010
    Location
    Dhaka
    MS-Off Ver
    Excel 2003
    Posts
    14

    Copy and Paste Non-contiguous Range

    Hi All,

    I am new to this forum. I believe I would get solution from this forum to my problem in working with multiple non-contiguous range values. I need to copy data from 22 Worksheets in a workbook with Range in each worksheet as (F110:J110, F112:J117, F119:J119, F121:J128, K131:O132, K133:O133, K135:O137) and paste the cell value to the range (F10:J10, F12:J17, F19:J19, F21:J28, K31:O32, K34:O34, K36:O38) in the commonly designed 22 destination worksheets in another workbook. Please help to solve the problem with VBA macro code.
    Last edited by Rashed.R; 02-04-2010 at 10:34 AM. Reason: update

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Copy and Paste Non-contiguous Range

    try this. Open this workbook and also the 2 workbooks containing your sheets.

    This macro assumes that you have exactly the same sheets in both books, and they are both open.

    make sure you correctly add the names of the 2 books in cells A2 and B2, and you don't change the name of the workbook I have attached here.

    I have designed this so you can change the ranges if you like.

    Matt
    Attached Files Attached Files
    Last edited by Mallycat; 02-05-2010 at 04:52 AM.

  3. #3
    Registered User
    Join Date
    02-03-2010
    Location
    Dhaka
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Copy and Paste Non-contiguous Range

    Thank you very much for your kind help.

    I have tried your code. I have changed the code according to my requirement
    My source file name is "Book1.xls", I want to copy from this file.
    My destination file is "Book2.xls".
    There are 29 worksheets in "Book1.xls"
    and 44 worksheets in "Book2.xls"
    So i need to exclude some sheets to copy from "Book1.xls" and also
    to exclude some sheets to copy to "Book2.xls"
    The name of the worksheets to copy from and copy to are same.
    But the range to copy from are
    F110:J110
    F112:J117
    F119:J119
    F121:J128
    K131:O132
    K133:O133
    K135:O137
    And the range to copy To are
    F10:J10
    F12:J17
    F19:J19
    F21:J28
    K31:O32
    K34:O34
    K36:O38
    I am running the following code
    Please Login or Register  to view this content.
    After running the macro I found the values from range
    F112:J117
    F121:J128
    K133:O133
    Are not getting copied to the destination range
    F12:J17
    F21:J28
    K34:O34

    Please give me a soluction
    Waiting for ur vry knd rply
    Last edited by teylyn; 02-08-2010 at 07:57 AM. Reason: update

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Copy and Paste Non-contiguous Range

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I'll add the code tags for you this time, but I'll expect that you use them from now on.

    Also, please refrain from using chat room talk like this
    Waiting for ur vry knd rply
    Many members here may not be used to this lingo and it would be only fair to use a language that everybody understands.

    regards
    Last edited by teylyn; 02-08-2010 at 07:58 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1