+ Reply to Thread
Results 1 to 7 of 7

Random CellsValues from a range

  1. #1
    Registered User
    Join Date
    09-10-2020
    Location
    worcester
    MS-Off Ver
    2016
    Posts
    43

    Random CellsValues from a range

    Good Morning all,
    sorry to bother,
    I need to pick x(could be any nr between 1 and 6) cells values
    from a range like("B2:G50") where values are from 1 to 50, the numbers are random and not in order
    (could be duplicates in that range or some values could not exist in range).
    I dont need random exactly from 1 to 50 because not work for me.
    So, how to extract, x cells values from that range no duplicates in result and paste to
    let say from "U3:Y3".
    Must be a macro.
    thank you

  2. #2
    Forum Contributor
    Join Date
    11-20-2007
    Location
    Felixstowe, England
    MS-Off Ver
    Excel 2013, 2019
    Posts
    217

    Re: Random CellsValues from a range

    When you say "no duplicates" ... do you mean no cell selection duplicated? Because you've said there are values that are duplicated in the range, and so random cells could possibly choose 2 cells that have the same value, and so would look like duplicates.

  3. #3
    Registered User
    Join Date
    09-10-2020
    Location
    worcester
    MS-Off Ver
    2016
    Posts
    43

    Re: Random CellsValues from a range

    no duplicates in result

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Random CellsValues from a range

    I feel you want 5 random numbers from 1 to 50 in U3:Y3 without duplicates.
    This code gives the same
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 03-10-2021 at 08:05 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    09-10-2020
    Location
    worcester
    MS-Off Ver
    2016
    Posts
    43

    Re: Random CellsValues from a range

    Thank you very much for you answer
    but it is not what i am looking for,maybe it is little hard to understand what i need
    for 1 to 50 random nr like i said i now how to doit:
    Please Login or Register  to view this content.
    But Thank you very much for you time
    I sorted with couples of procedure what i want to do
    Thank you very much

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Random CellsValues from a range

    your code does not appear to filter out duplicates whereas @kvrsinivasamurthy's does

  7. #7
    Registered User
    Join Date
    09-10-2020
    Location
    worcester
    MS-Off Ver
    2016
    Posts
    43

    Re: Random CellsValues from a range

    thank you very much

+ 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] generate random numbers in random range vba
    By hsnfifo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2020, 12:59 PM
  2. Change code to take a random value in a range, instead of the highest value in the range
    By Martin Lorentzen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2016, 06:21 AM
  3. Get random names from a range
    By Immortal2014 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2015, 02:58 PM
  4. Random (Rand) (Range) = Sum
    By DevinStark in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-28-2015, 09:32 AM
  5. Random numbers in range
    By hockey123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2010, 11:22 PM
  6. [SOLVED] Random within range
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-24-2006, 09:50 AM
  7. Random range averaging
    By Steve C in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-13-2005, 08: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