+ Reply to Thread
Results 1 to 10 of 10

Copy & Paste with Transpose from MANY files to ONE

  1. #1
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Copy & Paste with Transpose from MANY files to ONE

    Hi All! This is my first post, I recently started using Excel VBA and was hoping to get some help!

    I need to copy content from multiple files Range("E7:E35") (column form) and transpose them into a "Master" worksheet in row format (one after the other).

    I found code to help select a folder and go through the files; however, I keep getting a runtime error 91 "Object variable or With block variable not set"
    (sorry can't link source because I'm a new user, but see code below)


    I tried changing the reference in "Tools" to "Microsoft Office 16.0 Object Library" ONLY, but I was not able to uncheck or reprioritize "VBA" or "Microsoft Excel 16.0 Object Library", which are ahead of it.

    Please Login or Register  to view this content.

    Any help or comments would be appreciated!

    Thank you so much

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,042

    Re: Copy & Paste with Transpose from MANY files to ONE

    What is the name of the source sheet in each file? What is the extension of each source file (xlsx, xlsm)? Are the source files the only files in the folder that contains them? Do you want to select the folder or do you want the macro to automatically open the files in the source folder? If you want the macro to do the work, what is the full path to the folder containing the source files?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Re: Copy & Paste with Transpose from MANY files to ONE

    Quote Originally Posted by Mumps1 View Post
    What is the name of the source sheet in each file?
    Name of source sheet is "Sheet1"


    Quote Originally Posted by Mumps1 View Post
    What is the extension of each source file (xlsx, xlsm)?
    Extension is .xl**
    (Varies from file to file)

    Quote Originally Posted by Mumps1 View Post
    Are the source files the only files in the folder that contains them?
    Yes, the source files are the only files in the folder.
    I'd like to be able to select one at a time, because they are grouped by different indicators, but are all formatted the same way in terms of what range will be selected.


    Quote Originally Posted by Mumps1 View Post
    Do you want to select the folder or do you want the macro to automatically open the files in the source folder?
    I want the macro to automatically open the files in the selected folder

    Quote Originally Posted by Mumps1 View Post
    If you want the macro to do the work, what is the full path to the folder containing the source files?
    /Users/name/Desktop/Coded/Duplicates/Coding sheets

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,042

    Re: Copy & Paste with Transpose from MANY files to ONE

    Try:
    Please Login or Register  to view this content.
    You must have a sheet named "Master" in your master workbook.
    Last edited by Mumps1; 11-29-2018 at 04:30 PM.

  5. #5
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Re: Copy & Paste with Transpose from MANY files to ONE

    I have a bunch of files in a multiple folders, then the workbook that the macro is in acts as my "Master" sheet where I want to compile all the data.
    I'd like to be able to run the code separately for each folder, that's why I was initially looking at the folderpicker command.

    Please Login or Register  to view this content.
    Is there possibly anything wrong in my settings?

  6. #6
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Re: Copy & Paste with Transpose from MANY files to ONE

    I just read that FileDialog is not available for Macs, I'm going to try and run this on a PC and will report back soon

  7. #7
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Re: Copy & Paste with Transpose from MANY files to ONE

    Now that I'm working on windows, I am able to use the folder picker.
    I'm getting a run-time error 1004 Application-defined or object defined error.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,042

    Re: Copy & Paste with Transpose from MANY files to ONE

    Try changing the "1" to "A" in this line:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-29-2018
    Location
    MA
    MS-Off Ver
    16.16.3
    Posts
    6

    Re: Copy & Paste with Transpose from MANY files to ONE

    It worked, thank you!

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,042

    Re: Copy & Paste with Transpose from MANY files to ONE

    My pleasure.

+ 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] Copy, Transpose & Paste
    By Vcare in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2018, 09:10 AM
  2. copy and paste with transpose
    By atwy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-27-2015, 10:24 AM
  3. copy paste transpose
    By alexanderdeluna in forum Excel General
    Replies: 2
    Last Post: 09-19-2013, 06:32 PM
  4. Copy from Array in ActiveWorkbook to ThisWorkbook; Transpose copy, Offset Paste
    By sbradley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 05:17 PM
  5. Transpose without copy and paste
    By SSS777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2013, 02:24 AM
  6. [SOLVED] Copy paste and transpose
    By gilko86 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2012, 12:23 PM
  7. for each sh copy paste value and transpose
    By mhni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-04-2009, 01:51 PM

Tags for this Thread

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