+ Reply to Thread
Results 1 to 6 of 6

Macro needed to Add New Column, and Name Header - From Dynamic List.

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Billtown, PA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Macro needed to Add New Column, and Name Header - From Dynamic List.

    Greetings All,

    I have an ever growing Dynamic List of Names. Each Name is the Header of a Table Column. There are 12 Tables on 12 Worksheets.
    Each time a New Name is added to the Dynamic List, each table must increase by 1 column with the Name as the new header.

    I have searched the internets for anything that might help me create a 'simple' macro, OR formula, that will look at the dynamic list, and do my bidding, as a new name is entered... and add a New Named Column to the end of each Table.

    I KNOW I came to the right place for answers.

    This doesn't require a spreadsheet posting.

    Thank you

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro needed to Add New Column, and Name Header - From Dynamic List.

    Hi sljones

    Are these true Excel Tables on each Worksheet or are they simply a normal range of cells?

    Where does the Dynamic List of Names live? Are they on a separate Worksheet? What's the Name of that worksheet? What's the Name of that Dynamic Range? Will the new Column Header Name ALWAYS be added on the next available row?

    Perhaps a Sample File IS appropriate?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    05-22-2013
    Location
    Billtown, PA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro needed to Add New Column, and Name Header - From Dynamic List.

    Thank you jaslake for the reply and WISE suggestion. Nothing is as simple as it seems, I should know!

    1. The 'Tables' reside on the monthly sheets. For each Driver (the dynamic list), for each workday, a drop-down list will indicate a specific location.
    This information is tracked for each month; (12 tables).
    2. The dynamic list (Drivers) resides on the 'Data Sheet', along with the locations, months, and YTD trips.
    3. The 'YTD Rept' is the front sheet, which is full of formula to show the trips made, by month and year total. (the [Month] cell is a drop-down for
    for each month totals.
    ------
    Drivers come and go; so as each driver is added or deleted... I hope to create a macro that will add a new name to the dynamic list of =Drivers, and also insert a new column to Each table... and/or delete them. Yes, it could be done 1 at a time on each month Table - but that would take all the fun out of using a userform or macro!
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro needed to Add New Column, and Name Header - From Dynamic List.

    Hi SLJones

    This Code is in the attached
    Please Login or Register  to view this content.
    The Code is in the Data Sheet Module and, as you can see, it's Change Event Code.

    A couple things you need to be aware of:
    1. I've changed your Sheet Names to conform("Jan." becomes "Jan", "Feb." becomes "Feb", etc, etc)
    2. I've changed the Table Name on Sheet Sep from "TableSept" to "TableSep" to conform

    As you see, the Code does not run from a UserForm
    but that would take all the fun out of using a userform
    as there is no UserForm in your WorkBook. Also, there's no Code to delete Drivers
    so as each driver is added or deleted...and/or delete them
    This "Stuff" can be added as you develop the Project. I believe the above Code address the issue of this Thread.

    Let me know of issues.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-22-2013
    Location
    Billtown, PA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro needed to Add New Column, and Name Header - From Dynamic List.

    Thank you very much jaslake!
    You really helped me out immensely.. With just a little tweaking and head-scratching, I was able to get things working just as I hoped.
    ** (Reputation to you !)

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro needed to Add New Column, and Name Header - From Dynamic List.

    You're welcome...glad I could help. Thanks for the 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. [SOLVED] Dynamic top 10 list (3 variables needed)
    By MTAL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-18-2013, 04:49 AM
  2. [SOLVED] Formula Needed to Return Entire Column Under Header on Second Sheet
    By bigtunelover in forum Excel General
    Replies: 1
    Last Post: 01-27-2012, 11:19 PM
  3. Macro needed to create custom/dynamic header
    By astohl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2011, 06:44 PM
  4. Multi Row Sorting & Create Header Row from Dynamic List
    By drew138 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2009, 03:39 PM
  5. How do I set a dynamic range based on the column header?
    By gimiv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2007, 03:25 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