+ Reply to Thread
Results 1 to 2 of 2

Select Random Names and Addresses from excel spreadsheet

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    Redditch, England
    MS-Off Ver
    Excel 2010
    Posts
    35

    Select Random Names and Addresses from excel spreadsheet

    Hi all

    On a monthly basis I want to run a report which lists the names and address of customers who have purchased a certain product. What I would like and really need some help on is a macro that will randomly select a number of them to another worksheet in order to create a mailing list to do a mail merge.

    Can anyone help me please

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Select Random Names and Addresses from excel spreadsheet

    Quote Originally Posted by mjg060468 View Post
    Hi all

    On a monthly basis I want to run a report which lists the names and address of customers who have purchased a certain product. What I would like and really need some help on is a macro that will randomly select a number of them to another worksheet in order to create a mailing list to do a mail merge.

    Can anyone help me please
    Hi,

    The way I'd approach this is to use a helper column and in this column add a formula
    =IF(prod_num_cell="your required prod_num",RAND(),9999999)
    Copy this down and then convert it to values with pastespecial values.

    Now sort the data on the helper column and copy the top x rows to your other sheet.
    If you don't want to sort the original data the just copy all the data to the second sheet, do the above and then delete all the rows after the first x rows.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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