+ Reply to Thread
Results 1 to 6 of 6

VBA to add Worksheet Name after the last column of a Table

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    116

    VBA to add Worksheet Name after the last column of a Table

    Hi all,

    I have a folder which contains several Excel workbooks. Each Workbook has got only 1 Worksheet with a specific name and each Worksheet contains a single Table (number of columns of that Table are not the same for each Worksheet).

    Is it possible to run some VBA codes that would automatically run on that folder and create a new column (say, WorksheetName) at the end of the Tables and fill its relevant rows with its Worksheet Name?

    Any help would be much appreciated.


    Attachment (sample Worksheet):

    https://www.excelforum.com/attachmen...1&d=1651947172
    Attached Files Attached Files
    Last edited by zicitron; 05-07-2022 at 02:14 PM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA to add Worksheet Name after the last column of a Table

    Yes it is...Pls upload a sample file depicting actual setup of said workbooks...You say Table...Is it an actual Table(ListObject) or Range...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: VBA to add Worksheet Name after the last column of a Table

    Quote Originally Posted by sintek View Post
    Yes it is...Pls upload a sample file depicting actual setup of said workbooks...You say Table...Is it an actual Table(ListObject) or Range...
    Sample file attached. Thanks for looking into same.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA to add Worksheet Name after the last column of a Table

    Change red snippet to path housing files...
    Please Login or Register  to view this content.
    Last edited by sintek; 05-07-2022 at 02:28 PM.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Mauritius
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: VBA to add Worksheet Name after the last column of a Table

    Thanks a lot! Highly appreciated.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA to add Worksheet Name after the last column of a Table

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Glad I could assist...Tx for Rep +

+ 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: 0
    Last Post: 11-13-2021, 02:57 PM
  2. [SOLVED] Finding array of values unique to one table column compared to another table column
    By TimRC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-23-2021, 10:16 PM
  3. [SOLVED] Table column to automatically replicate dates from another table column
    By Dbroek in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-19-2020, 01:46 PM
  4. Replies: 12
    Last Post: 03-22-2019, 01:54 AM
  5. [SOLVED] Table column have amount, worksheet hidden
    By Shermaine2010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2016, 12:58 AM
  6. [SOLVED] Cross-check one column in a table with a list of names on another worksheet...
    By thegnord in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2015, 10:30 PM
  7. VBA to find last column on a worksheet with a pivot table
    By nguerra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2014, 03:05 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