+ Reply to Thread
Results 1 to 2 of 2

Adding a column that says the file name data is orignally from

  1. #1
    Registered User
    Join Date
    10-20-2016
    Location
    Pittsburgh
    MS-Off Ver
    2016
    Posts
    6

    Adding a column that says the file name data is orignally from

    I wrote a vba script that combined a bunch of workbooks into one master workbook. I want to add a line of code that will basically say which file the data originally came from. Preferably in the last column.

    So for example, if the first 20 rows of data came originally from the file "January" a column at the end will be added that says January for all 20 rows.

    Here is my script so far:
    Please Login or Register  to view this content.
    Last edited by alansidman; 10-20-2016 at 05:07 PM.

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

    Re: Adding a column that says the file name data is orignally from

    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



    (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

+ 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. Adding a CSV file always adds an extra column
    By NatalieEC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2014, 03:02 PM
  2. Adding 2 columns to every other (current) column - file size,speed
    By scruz9 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-10-2014, 11:26 PM
  3. Adding a row of data from one file to a Master File...
    By bwetz34 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-01-2014, 11:13 PM
  4. Adding file name to an adjacent column of imported .dat files
    By cfell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-29-2013, 02:44 PM
  5. [SOLVED] adding target lines into graphs without adding an extra column of data
    By ea223 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-16-2013, 12:32 PM
  6. Replies: 8
    Last Post: 11-12-2012, 02:39 PM
  7. Adding a column in 5000 excel file at a time
    By arehmanbtc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2007, 09:38 AM

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