+ Reply to Thread
Results 1 to 8 of 8

Auto product code generation with user form

Hybrid View

Ramesh h&m Auto product code generation... 07-25-2017, 07:11 AM
AliGW Re: Auto product code... 07-25-2017, 07:20 AM
Special-K Re: Auto product code... 07-25-2017, 07:21 AM
Shareez Saleem Re: Auto product code... 07-25-2017, 07:29 AM
Ramesh h&m Re: Auto product code... 07-25-2017, 08:24 AM
AliGW Re: Auto product code... 07-25-2017, 08:30 AM
Arkadi Re: Auto product code... 07-25-2017, 08:44 AM
Ramesh h&m Re: Auto product code... 07-26-2017, 12:18 AM
  1. #1
    Forum Contributor
    Join Date
    03-28-2016
    Location
    india
    MS-Off Ver
    2013 (in 2023)
    Posts
    134

    Auto product code generation with user form

    Hi,

    I have a user form in excel.
    User-form created to add product details in the excel sheet.
    The product details will be
    A2. S no
    B2. Brand name (column
    C2. product name
    D2. Description
    E2. size
    F2. color
    G2. pages
    H2. unit
    I2. Product code

    i need to generate a product code for every products added in this sheet.

    Pls find the attached sample template and advise if more details you need..
    Attached Files Attached Files

  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. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,255

    Re: Auto product code generation

    See this thread from a few moments ago: https://www.excelforum.com/excel-gen...er-column.html

    EDIT: Apologies - I did not see the user form requirement. This needs to be in the VBA section - I'll move the thread for you.
    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
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Auto product code generation

    in I3
    =IF(B3="","","A"&TEXT(ROW()-2,"0000"))
    and copy down the column
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    697

    Re: Auto product code generation with user form

    If(c3<>"",concatenate("a",text(rows($a$1:a1),"0000"),""))

  5. #5
    Forum Contributor
    Join Date
    03-28-2016
    Location
    india
    MS-Off Ver
    2013 (in 2023)
    Posts
    134

    Re: Auto product code generation with user form

    Hi
    Alig tks...
    Special-K... wow super code and works perfectly tks..
    Shareez.. tks

  6. #6
    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. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,255

    Re: Auto product code generation with user form

    OK, so the code does not have to be generated on the user form?

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Auto product code generation with user form

    I helped the OP with the code for the useform that adds a product, in there is a VBA solution already as well? Granted, part of much more code, but this line in that post generates the "next" code based on the last row with a code in it:

    .Range("I" & lr).Value = Left(.Range("I" & lr - 1).Value, 1) & Format(Val(Mid(.Range("I" & lr - 1).Value, 2)) + 1, "0000")
    @Ramesh, did the code I provided in that previous thread not work well?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  8. #8
    Forum Contributor
    Join Date
    03-28-2016
    Location
    india
    MS-Off Ver
    2013 (in 2023)
    Posts
    134

    Re: Auto product code generation with user form

    Quote Originally Posted by Arkadi View Post
    I helped the OP with the code for the useform that adds a product, in there is a VBA solution already as well? Granted, part of much more code, but this line in that post generates the "next" code based on the last row with a code in it:

    .Range("I" & lr).Value = Left(.Range("I" & lr - 1).Value, 1) & Format(Val(Mid(.Range("I" & lr - 1).Value, 2)) + 1, "0000")
    @Ramesh, did the code I provided in that previous thread not work well?
    Hi Arkadi,

    Don't mistake me..

    After replied you on my previous thread, i found this auto generation code is not working. The particular code turned in to red.
    I am sure that, not missed anything in the code but i don't know why its not working..

    Then, i think it will be possible in excel functions. Hence i requested excel formula in a new thread to cleared it.

    @Aligw.. I am happy to get help from Arkadi for do my user-form project successful.

    As i am new to the VBA, if i get any error in the codes, I don't like to give burden for the experts, to ask about the errors.

    Hence i think simply to solve it by excel formulas.

+ 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. auto code generation from list of ID's
    By Identis in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-01-2017, 05:11 AM
  2. [SOLVED] Product/stock history generation
    By kprabhupaul in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-06-2016, 08:23 AM
  3. Macro for Name Generation from Product to Product with Sizes and Filenames
    By ddenicola in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-30-2014, 11:59 AM
  4. Replies: 2
    Last Post: 12-06-2013, 06:06 AM
  5. Auto Generation of String based on user input
    By dhimbak in forum Excel General
    Replies: 3
    Last Post: 06-04-2009, 09:12 AM
  6. Auto Fill Web Form using Excel User Form
    By vandanavai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2008, 02:26 AM
  7. Auto adjusting a user form
    By David Looney in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2005, 09:05 AM

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