+ Reply to Thread
Results 1 to 7 of 7

Perhaps Macro Help? Automatic Fill In Function?

  1. #1
    Registered User
    Join Date
    06-09-2021
    Location
    Austin
    MS-Off Ver
    2016
    Posts
    11

    Perhaps Macro Help? Automatic Fill In Function?

    Good morning to all you, my favorite helpers!


    I have attached a document as an example. In the document are some items for sale. I have been manually assigning an Item # (B2-B11) to each item. Is there a way to have an Item # automatically assigned when a new item is added, ideally once I select its category in (A2-A11). I'd want the Item # to be consecutive in series of course. So, If I were to select "General" in the Category column; A8 for instance, it then automatically fill B8 with GE1.

    In short; How would I get B8, B9, Etc. to automatically fill in with GE1, GE2, Etc.; ideally after selecting "General" as the items category.



    Thanks in advance, and LOVE YOU!

    Eric
    Attached Files Attached Files
    Last edited by ephipps12; 01-21-2022 at 03:09 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Perhaps Macro Help? Automatic Fill In Function?

    Put the codes that you want to use for each category against each type, i.e. starting in G6:

    A
    AP
    B
    CC
    PC
    G
    HH

    Then you can use this formula in B2:

    =IF(A2="","",VLOOKUP(A2,$F$6:$G$12,2,0)&COUNTIF(A$2:A2,A2))

    Copy this down as far as you need to.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-09-2021
    Location
    Austin
    MS-Off Ver
    2016
    Posts
    11

    Re: Perhaps Macro Help? Automatic Fill In Function?

    I updated the spreadsheet attachment to reflect the changes you suggested and simplified it as well, please take a look.


    I tried playing around with it and couldn't quite understand. What would go into B8 & B9 for example so that it could be auto generated to read "GE1" & "GE2"?



    Thank you for your patience.

  4. #4
    Registered User
    Join Date
    06-09-2021
    Location
    Austin
    MS-Off Ver
    2016
    Posts
    11

    Re: Perhaps Macro Help? Automatic Fill In Function?

    Quote Originally Posted by Pete_UK View Post
    Put the codes that you want to use for each category against each type, i.e. starting in G6:

    A
    AP
    B
    CC
    PC
    G
    HH

    Then you can use this formula in B2:

    =IF(A2="","",VLOOKUP(A2,$F$6:$G$12,2,0)&COUNTIF(A$2:A2,A2))

    Copy this down as far as you need to.

    Hope this helps.

    Pete


    I updated the spreadsheet attachment to reflect the changes you suggested and simplified it as well, please take a look.


    I tried playing around with it and couldn't quite understand. What would go into B8 & B9 for example so that it could be auto generated to read "GE1" & "GE2"?



    Thank you for your patience.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Perhaps Macro Help? Automatic Fill In Function?

    You copy the formula that I gave you above into cell B2, and then just copy it down as far as you need it (even beyond the data that you have currently, so that it will give you the next values when you add new data).

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    06-09-2021
    Location
    Austin
    MS-Off Ver
    2016
    Posts
    11

    Re: Perhaps Macro Help? Automatic Fill In Function?

    Quote Originally Posted by Pete_UK View Post
    You copy the formula that I gave you above into cell B2, and then just copy it down as far as you need it (even beyond the data that you have currently, so that it will give you the next values when you add new data).

    Hope this helps.

    Pete
    Yes, It functioned properly! Thank you so much. I love you! If you want to send me your cashapp, venmo, zelle, or paypal I'll send you a tip to buy your next beer, I insist! I truly appreciate the help!


    Thanks again!

    Eric

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Perhaps Macro Help? Automatic Fill In Function?

    All help on the forum is offered for FREE - we just like to share our knowledge around !!

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Make an automatic fill on different sheet which sorted fill
    By stermy in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-11-2016, 09:23 AM
  2. Automatic Fill in formula
    By dlenoxx in forum Excel General
    Replies: 2
    Last Post: 08-31-2009, 08:43 PM
  3. Automatic fill incriment
    By timboellis2031 in forum Excel General
    Replies: 1
    Last Post: 03-03-2008, 08:52 PM
  4. Automatic cell fill, based on answer from VLOOKUP function
    By cptwhite in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-04-2008, 12:44 PM
  5. automatic fill
    By vkuppa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2007, 02:08 PM
  6. [SOLVED] Use IF function to automatic run macro
    By YS Lee in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2006, 03:15 PM
  7. Macro - Modular fill function
    By Chaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2005, 02:05 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