+ Reply to Thread
Results 1 to 5 of 5

Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

    Hi, is there a simple way to copy cells from WorkbookA (Sheet1.range("A1"), Sheet2.range("B1"), Sheet3.range("C1")) to WorkbookB row A(A1,A2,A3)? Thanks.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

    Hi
    Why not just link from WB B to A. e.g.

    =[WorkbookA.xlsx]Sheet1!$A$1

    However I suspect this isn't the whole story and this may be a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy), and manually add the results you expect to see. Clearly identify which is original data and which are the results and in a note clearly explain how you have arrived at your results.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

    Hi Richard, yes, not as simple as that, as WorkbookA changes as it's a live form that changes every shift, therefore I want to capture that info onto another workbook in which the list will grow every shift.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

    It seems you're doing a simple Transpose. i.e. copying from a row of cells to a column of cells.

    Why not record a macro in wb B to do that and upload it. We can then generalise it for you.

  5. #5
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Need code to copy cells from various worksheets in WorkbookA to a row in WorkbookB

    What I've decided to do which seemed to be the easiest, is link all the cells on the six worksheets that I want( which amounts to 35) to a row off to the side of one worksheet, then I will just copy that range of cells to the new workbook. I also used a very simple example, it may look like I am transposing but in reality the cells are all over the worksheet, but that I can figure out, just need a basic code to get me started. Thanks for your suggestions.
    Last edited by thecdnmole; 06-27-2021 at 12:49 PM.

+ 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] WorkbookA checkbox values to have values (yes/no) copied to WorkbookB cells
    By moyerw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2021, 11:41 AM
  2. copy certain cells from all worksheets to one sheet. Need review of my VBA code.
    By ChrisLo87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2017, 11:44 AM
  3. [SOLVED] Copy Data from WorkbookA to WorkbookB
    By Butlerjw78 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2015, 03:02 PM
  4. Trying to finish a VBA code to copy cells from multiple workbooks and worksheets
    By sweetnasty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2014, 11:56 PM
  5. [SOLVED] Copy cells/range from worksheets positioned between two worksheets
    By ucladidas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2014, 12:12 PM
  6. Insert open workbookA as hyperlink to workbookB
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2014, 12:58 PM
  7. Copy and paste data in different worksheets of workbookA to diff worksheets in workbookB
    By preciousmetal2004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-24-2012, 05:50 PM

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