+ Reply to Thread
Results 1 to 5 of 5

Generate combination of numbers

  1. #1
    Forum Contributor
    Join Date
    05-25-2020
    Location
    Madurai
    MS-Off Ver
    Excel 2010
    Posts
    136

    Generate combination of numbers

    Hi

    Please help me to create VBA code on the below





    Column CC and Category is user input, based on the User input the result required on next column

    First 3 Digit number and Next 3 digit number in result should be updated based on user input on message box
    USER TYPE
    APPLE then 333 300
    Orange then 433 400
    Papaya then 383 700

    Next 4 Digit number is from above user input in column B, if its blank then four zero '0000' to be considered
    Next 5 Digit number is from above user input in column C, if its blank then five zero"00000' to be considered
    Remaining all is default numbers (.0000.00000.000.000.000.000)


    Here column B and C is for example, it may be in Column H & I or J&K
    So by selection of CC and Category Numbers, the VBA code has to be executed for results

    Step1 User will select the CC & Category Range ( in Example its column B and C)
    Step2 Message box input required (To type "Apple", "Orange" and "papaya") to update first and next 3 digit numbers in Result columns
    Step3 Next four digit number to be updated based on the user selection on Step1, if its blank the "0000" to be updated
    Step4 Next five digit number to be updated based on the user selection on Step1, if its blank the "00000" to be updated
    Step5 default number as ".0000.00000.000.000.000.000" to be updated
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by KKR1975; 08-24-2020 at 06:41 AM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Generate combination of numbers

    Select the two columns of cells and run this macro:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    05-25-2020
    Location
    Madurai
    MS-Off Ver
    Excel 2010
    Posts
    136

    Re: Generate combination of numbers

    Hi Bernie Deitrick

    Thank you so much for your help.

    The code is working perfectly as expected.

    Only one issue, the message box is asking to type input for each rows, instead its required only one time to select 1, 2 or 3
    Ex. if user selected 1 entire selected rows updated accordingly.


    Please help me to modify

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Generate combination of numbers

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-25-2020
    Location
    Madurai
    MS-Off Ver
    Excel 2010
    Posts
    136

    Re: Generate combination of numbers

    Hi Bernie Deitrick

    Excellent. code is working exactly what i want. thank you so much for your help
    T

+ 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] How to make the combination of numbers and total of that combination should be in range?
    By Darshan Shah in forum Excel Programming / VBA / Macros
    Replies: 38
    Last Post: 06-20-2020, 01:20 PM
  2. [SOLVED] Generate Heads Tails Combination Result VBA
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-26-2018, 10:37 AM
  3. Generate Head Tale Combination Result
    By MoldyBread in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-26-2018, 08:18 AM
  4. Generate list of combination from chosen factors
    By Corsa88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2016, 01:06 AM
  5. How to generate a list of pairs for all combination possible?
    By treue in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2015, 09:23 AM
  6. [SOLVED] How to generate a list of pairs for all combination possible?
    By Laeticha in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-05-2015, 08:56 AM
  7. I need to generate a list of combination
    By ciprianb in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 02-28-2011, 01:28 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