+ Reply to Thread
Results 1 to 3 of 3

Working with a combined workbook macro and need to add filename from each source book to C

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Kansas City, MO
    MS-Off Ver
    2010
    Posts
    2

    Working with a combined workbook macro and need to add filename from each source book to C

    Excel Ver. 2010

    I have built a WB that combines the data from 50 or so WBs with a list of the files in Tab "List" and the data from each WB into Tab "Data"

    I need to import the file name and write it into Column A of the Data tab. I know I will need to move the copy to column 2 and can do that. My problem is that the only code I see is how to fill data that is already in the source sheet such in the code below. My file name is not in the data sheets I am combining, so the code below does not work for that.

    I am using a list of the files from the Tab "List"

    Code from Live Lessons: Excel VBA and Macros with Mr Excel:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks!
    -SS
    Last edited by ShadowSaxx; 09-16-2014 at 12:05 PM. Reason: code tags

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Working with a combined workbook macro and need to add filename from each source book

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    Kansas City, MO
    MS-Off Ver
    2010
    Posts
    2

    Re: Working with a combined workbook macro and need to add filename from each source book

    Yes, the code works.

    I have been able to bring all of the data from the WBs into the data sheet. I just need to know what file it came from.

    -SS

+ 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. Replies: 2
    Last Post: 09-14-2014, 04:38 PM
  2. Save as dialog box, value from listbox in filename combined with text
    By Masun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2013, 08:53 AM
  3. Want to Hide a UserForm source book while keeping main XL workbook open...
    By MBlaster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2012, 05:52 PM
  4. Replies: 0
    Last Post: 11-01-2012, 09:28 AM
  5. macro not working once filename changes
    By XCESIV in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2006, 10:45 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