+ Reply to Thread
Results 1 to 6 of 6

How to delete randomly 20 numbers in the column?

  1. #1
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    How to delete randomly 20 numbers in the column?

    Good morning to the community!
    I would like to delete 20 numbers randomly in the column C.
    Can you help me to do this?
    Thank you very much for your answer!
    Capture.PNG
    Attached Files Attached Files
    Last edited by Luu4466; 09-13-2021 at 06:14 PM.

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: How to delete randomly 20 numbers in the column?

    Hi, maybe you could use something like this:
    Please Login or Register  to view this content.
    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: How to delete randomly 20 numbers in the column?

    @Eastw00d: Unlesss I misunderstand I think there may be a small issue with your VBA solution. There's a small chance that you get the same random number more than once during the 20 loops in which case you will end up with less than 20 rows to delete.

    @Luu4466: Attached is a non-VBA solution if you prefer. It does however have the disadvantage of requiring some manual steps. Attached is a trimmed down version of your file illustrating the method.
    In N2 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In O2 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In P2 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Sort by column-P then delete the rows with "remove" in column-P
    Attached Files Attached Files
    Geoff

    Did I help significantly? If you wish, click on * Add Reputation to say thanks.
    If your problem has been resolved please select ?Solved? from the Thread Tools menu

  4. #4
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: How to delete randomly 20 numbers in the column?

    @Geoff,
    Thanks for your remark!
    There is a small chance if the mentioned row still exist after a loop (in case of the coloring), but they are deleted.

    Cheers
    Erwin

  5. #5
    Forum Contributor
    Join Date
    11-07-2020
    Location
    Paris
    MS-Off Ver
    Microsoft office 365
    Posts
    175

    Re: How to delete randomly 20 numbers in the column?

    Thank you a lot for your solution @GeoffW283.
    Thank you a lot for your proposal @Eastw00d.

  6. #6
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: How to delete randomly 20 numbers in the column?

    Thanks for the feedback. Glad we could help.

+ 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] randomly generate * 3 numbers per column and three per line.
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2019, 06:42 AM
  2. [SOLVED] Need to Randomly pick numbers in column with a formula
    By pradeepdeepu_001 in forum Excel General
    Replies: 6
    Last Post: 05-18-2017, 02:39 AM
  3. [SOLVED] Pls help with randomly generating numbers from a specific grid of numbers
    By ds2020 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2015, 09:16 AM
  4. [SOLVED] Insert row numbers into column A, reflect correct row numbers when I add or delete rows
    By jcambell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 02:18 PM
  5. [SOLVED] delete numbers and replace with numbers from adjacent column
    By troysie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-13-2010, 05:31 AM
  6. Program to randomly selecting numbers from a group of numbers
    By flexalong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2008, 04:22 AM
  7. to find missing serial numbers in randomly generated numbers
    By B.H. Hadi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2005, 07:00 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