+ Reply to Thread
Results 1 to 16 of 16

copying data in a non-contiguous column

  1. #1
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    copying data in a non-contiguous column

    hi, i just need a way to copy non-contiguous data from a column, but based on the number of rows in another column that has contiguous data in it. in the example below i want to copy all the 5 (number of entries in col A) data points in col b including the blanks.


    A B
    a text 1
    b
    c text 2
    d
    e

  2. #2
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: copying data in a non-contiguous column

    not sure if you mean that col B should match col A or you want col A to copy to a different column?

    thoughts

  3. #3
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    eventually all the data in col B will get copied to a different location, but for now I just need the command/steps to copy all of the data in col B (down to the last row in col A). I was using the code below but that only goes down to the end of data, which in this case would be "text 2", not down to the final blank across from where the "e" is in col A.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    You can try
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    thanks fluff13. that does work but i was just using that as an example. my actual data has the contiguous data in col "D" and the copying non-contiguous data in col "AT." when i modify the columns in your statement it gives me everything in between also. don't know if there's a way to copy just col "AT" in my actual data based off the rows in col "D."

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    Try
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    Thanks. Even though the offset is hard coded, that does work. however, now when I try to paste that data somewhere else on the sheet, i get an "Run-time error 1004 PasteSpecial method of Range class failed." I am using the statement below. Any idea why I am getting that error?

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    Is the selection the same size as the range copied?

  9. #9
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    in my actual data col AT has 25 rows but only 4 entries with the rest being intermittent blanks. i want to copy all the 25 entries over to another spot. if i do it manually it works.

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: copying data in a non-contiguous column

    Something like
    Please Login or Register  to view this content.
    or, if it doesn't start at row 1,

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  11. #11
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    thx. but the number of rows is based off of the total number of rows in cold D, so it's only 25 for now but it can change. the destination range cell won't always be in the same spot but where the cursor ends up.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    How do you determine where to paste the data?

  13. #13
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    @Fluff13, it actually goes into a separate workbook into a template that looks like the original data but is blank waiting for the new data to to be pasted there.

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    Maybe
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    12-02-2010
    Location
    USA
    MS-Off Ver
    Excel 365 and sometimes excel 2013
    Posts
    172

    Re: copying data in a non-contiguous column

    @fluff13, thanks. that kind fo works but i was able to take some of your earlier stuff and make it work, so it works now. thanks for your help.

  16. #16
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: copying data in a non-contiguous column

    You're welcome & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] entering data in a contiguous data column
    By charliec in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-11-2019, 04:25 PM
  2. [SOLVED] clear a column with non-contiguous data
    By charliec in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2019, 03:08 PM
  3. Pulling non-contiguous data into a contiguous set.
    By blake.thompson in forum Excel General
    Replies: 4
    Last Post: 12-10-2015, 05:49 PM
  4. [SOLVED] Selecting Non-Contiguous Cells Containing Data in a Column
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2014, 05:26 PM
  5. [SOLVED] Expand on Parse Function/ Column to Column - Contiguous Data to include quantities
    By arcamp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-21-2013, 05:18 PM
  6. Copying a set of non-contiguous values to a different range shape
    By jimredfield in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-08-2013, 12:08 PM
  7. [SOLVED] Copying and appending non contiguous colums to a new worksheet
    By Kespin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 10:08 AM

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