+ Reply to Thread
Results 1 to 6 of 6

Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

  1. #1
    Registered User
    Join Date
    07-22-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    Hello,
    I am looking to make a master table in a master sheet that pulls non contiguous cells from each worksheet. The code works fine if there are always values in the cells I am looking to copy to a master worksheet. However, if one of the worksheets is missing a value in a cell I select, the same cell from the next worksheet is placed where a blank should be in that row. (To try to put it bluntly: row 2 b2 should be blank, since ProcessName on the first sheet is blank, but the value from row3 b3 (ProcessName on the next sheet) has moved into b2.) I'm hoping someone can modify my code to help me account for blanks.

    Thanks

    Please Login or Register  to view this content.
    Last edited by Kahmed2R; 07-30-2013 at 11:59 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    Hi, Kahmed2R,

    instead of looking the last used cell up for each column look it up only for one column which is filled at any time and use that variable for the other columns as well:

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    07-22-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    I like the thinking, Holger, but I'm getting a 424 runtime error at
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,707

    Re: Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    Please Login or Register  to view this content.
    If that is indeed the code, delete the 2nd .Copy (Probably happened when copying)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-22-2013
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    Really appreciate the help, works great.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,707

    Re: Copy Non Contiguous Cells from multiple workbooks into one sheet - Problem with blanks

    You have to thank Holger. He gave you the code.

+ 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. Small Macro Problem..? Copy 20 cells from multiple sheets to one sheet
    By AbhijeetM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2013, 02:38 AM
  2. Replies: 1
    Last Post: 10-24-2012, 01:21 PM
  3. Looping A Copy Sheet for Multiple Workbooks
    By mburke05 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2012, 09:00 AM
  4. Copy non-contiguous cells from one sheet to another
    By Grizz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2010, 11:44 PM
  5. To Copy ranges from multiple workbooks to one sheet
    By psmcltraining in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2009, 05:25 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