+ Reply to Thread
Results 1 to 6 of 6

Copying/Pasting Data from All Files in Folder to Master Sheet According to Headers

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    Howell, Michigan
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Copying/Pasting Data from All Files in Folder to Master Sheet According to Headers

    Hello all,

    I'm new to coding vba. The goal of my macro would be to loop through all files in a folder running a macro that rearranges the files' format and copies the desired range. Then copy this range of data to a master sheet matching the data range to the correct header which is a date.

    So far I have code on the personal workbook that formats the individual files and copies the data range I want. I know there is code that can loop this macro through a folder running it on each file; I just have not integrated this code with mine yet. But, I do not know how I will be to match the copied data from the individual files to the column headers they need to be pasted under. It'd be much appreciated if anyone could help with this.

    The macro on the personal workbook reformats this original txt file.

    Original txt-min.png

    The macro turns the original text file into the format below.

    after mac.png

    So the overall vba code should be activated by the Weld Scrap Dollars button, call my macro (which is called WeldScrap()), and paste scrap dollar values to master sheet according to code and date.

    transfer2.png

    If anyone could help with this I'd really appreciate it!

    The vba code on the personal workbook I put in a word file attached to look at sorry for the inconvenience.
    Several input files and a skeleton of the master sheet are attached. I would attach the full master sheet if it wasn't due to file size constraints.
    Attached Files Attached Files
    Last edited by sdwhiteh; 07-22-2015 at 10:21 AM.

  2. #2
    Registered User
    Join Date
    07-21-2015
    Location
    Howell, Michigan
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Copying/Pasting Data from All Files in Folder to Master Sheet According to Headers

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Master sheet


    Hi !

    Quote Originally Posted by sdwhiteh View Post
    […] a macro that rearranges the files' format and copies the desired range.
    Then copy this range of data to a master sheet
    Seems you forgot to explain what is desired range ! And where is master sheet ?! Attach the workbook …

  4. #4
    Registered User
    Join Date
    07-21-2015
    Location
    Howell, Michigan
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Master sheet

    The desired range of data to copy would be the cells in the green box under "Scrap Dollars" in the second picture. So it would be E2:E17. And, sorry it forced me to wait an hour before I could upload any more attachments, but here is the master sheet attached.Scrap Master Sheet Rev3.xlsx

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Exclamation Text files issue …


    Not all very obvious but for now I can't read your attached text files with my usual code :
    got an error #62 Input past end of file

    If there are not your true files, attach a couple of real ones. Otherwise, I go my way …

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Exclamation Duplicate …

    Duplicate …
    Last edited by Marc L; 07-22-2015 at 01:27 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. Copying columns from one sheet and pasting to another based on headers
    By magnus12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2015, 10:43 PM
  2. Marcto to copy sheets from one workbook to a master sheet, for all files in folder
    By crombieguy91 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2013, 11:12 AM
  3. copying data from excel files in a source folder to target folder
    By Javed07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2013, 04:27 PM
  4. Opening 4 excel files, copying set table data and pasting into "master file".
    By Belloni in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-29-2012, 09:50 AM
  5. Copying data from multiple files in a folder to a master file
    By kjshep in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 12:31 PM
  6. Pasting data from a master file to two other files
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2009, 02:50 PM
  7. VBA Code for copying/pasting from Master-to-target files
    By Pedroluna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2009, 09:34 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