+ Reply to Thread
Results 1 to 3 of 3

VBA Add Column and Populate with Sheet Name

  1. #1
    Registered User
    Join Date
    03-07-2018
    Location
    Belfast
    MS-Off Ver
    2017
    Posts
    13

    VBA Add Column and Populate with Sheet Name

    Hi,
    Could anyone assist with some VBA which would add a Column to the beginning of a sheet, (Column A) and Populate the rows of new column with the first 8 characters of the sheet name. The file contains over 100 sheets, and we only require the first 8 characters of the sheet name to be added to the new row. The new row should only be populated for as many rows as which already contains data.

    Any help appreciated, I've found this code online, however it populates with the entire sheet name. Ideally the sheet names would also only begin to fill from Cell A3 not A1.



    Please Login or Register  to view this content.
    Any help much appreciated.

    Thanks
    Daniel
    Last edited by AliGW; 04-05-2018 at 04:12 AM. Reason: Code tags added.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,006

    Re: VBA Add Column and Populate with Sheet Name

    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.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I've done it for you this time.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-07-2018
    Location
    Belfast
    MS-Off Ver
    2017
    Posts
    13

    Re: VBA Add Column and Populate with Sheet Name

    Got it, rather simple in the end, coffee helped solve this one...

    Please Login or Register  to view this content.

+ 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] Populate column from another sheet
    By miro2021 in forum Excel General
    Replies: 4
    Last Post: 09-06-2016, 12:20 PM
  2. Replies: 5
    Last Post: 09-09-2015, 09:49 AM
  3. [SOLVED] Vlookup to populate from sheet but if column is empty then use a different one?
    By kellyfirth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2015, 07:40 AM
  4. Replies: 4
    Last Post: 02-25-2014, 10:26 PM
  5. Replies: 4
    Last Post: 08-01-2013, 01:57 PM
  6. [SOLVED] Populate summary sheet with values within specific month column on data sheet...
    By blue91 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2013, 12:11 PM
  7. Populate multi-column list in sheet not in UserForm
    By afzal001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2008, 12:26 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