+ Reply to Thread
Results 1 to 4 of 4

USING RANDOM FUNCTION Values

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    270

    USING RANDOM FUNCTION Values

    Hi All I am creating a table with the following headings

    Month
    Prod Code
    Item

    I am using a random function to fill in the details
    I want to fill in the item automatically in Item column based on the numbers generated in the prod.code column.

    My prod code generates number between 1 and 20 only.
    For example p002 in prod code the respective item column should show “Toyota”
    For example p003 in prod code the respective item column should show “Honda”
    For example p004 in prod code the respective item column should show “Volvo”

    My code is below. Where & when should i assign the item values to the product code


    Please Login or Register  to view this content.
    Last edited by grkchakri; 12-21-2013 at 03:30 AM.
    Never confuse a single defeat to the final defeat.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: USING RANDOM FUNCTION Values

    Hi, grkchakri,

    if you want to to hard-code the brand names you may work like this:
    Please Login or Register  to view this content.
    I´d suggest you work with a table and use WorksheetFnction.VLookUp to deliver the brand name.

    Ciao,
    Holger
    Last edited by HaHoBe; 12-21-2013 at 03:39 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    270

    Re: USING RANDOM FUNCTION Values

    you mean to say create a seprate product table with ids and names and use vlookup in my table . did i get that right

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: USING RANDOM FUNCTION Values

    Hi, grkchakri,

    exactly that - you would have less code and the ability to change within the sheet instead of changing code.

    Ciao,
    Holger

+ 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. random numbers between set values
    By thickmart in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2013, 07:24 AM
  2. VBA Creating Expandable Random Values Based on Values on a different Sheet
    By richter394 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2013, 03:14 PM
  3. Replies: 3
    Last Post: 09-30-2012, 03:03 PM
  4. Mutiple values to replace with multiple values random in fields
    By CatalinNic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-18-2011, 01:52 PM
  5. Function to match random list values to set list values.
    By Sandman4432 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-24-2007, 09:22 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