+ Reply to Thread
Results 1 to 11 of 11

How to create random sentences out of a list of words

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    9

    How to create random sentences out of a list of words

    Hello

    I need help with a macro which creates random sentences out of a list of words (I have a column with 2000 rows. Each cell contains 50-60 words). In each cell, I would like to create sentences - without meaning - for example one sentence contains 4 words, the next one 8, the next one 5...
    Basically the words should be separated randomly by a dot, and after each dot the next word has to begin with a capital letter.

    Any assistance you could provide would be really appreciated.

    Kind Regards

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to create random sentences out of a list of words

    Hi

    if you have 50-60 words in a cell, do you want to create a sentence from the words within that cell, or from any cell in the 2000 rows?
    and, are the words in the cells separated by spaces, comas, dots, or something else?

    cheers
    Nicky

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to create random sentences out of a list of words

    Hi
    this user-defined function will create a random list of 1 to 11 words from the contents of the target cell. It assumes the words in the target cell are separated by spaces.


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-07-2013
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create random sentences out of a list of words

    Hi Nicky

    I want to create sentences only in that cell (between 7 - 15 words per sentence). The words are separated by spaces and comas (word1, word2,... ). I would like to remove the comas.
    Let's say these are the words from the first cell:
    word1, word2, word3, word4, word5, word6, word 7, word8, word9, word10, word11, word12, word13, word14

    After I run the macro, I would like the cell to look like this:

    Word1 word2 word3 word4 word5 word6. Word 7 word8 word9. Word10 word11 word12 word13 word14.

    The dots should change the place randomly. If I run the macro again then I should have a new set of sentences:

    Word1 word2 word3 word4 word5 word6 word 7 word8 word9. Word10 word11 word12 word13 word14.

    and so on.

    This thing should happen for each cell from the column. I don't want the cells to be identical. Let's say that after I run the macro, I would like to have 5 sentences in the first cell, in the second cell 10 sentences, in the third cell 13 sentences, in the fourth cell 8 sentences... as randomly as possible.

    Thank very much.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to create random sentences out of a list of words

    How about just typing =lorem(10,4) into Word?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    11-07-2013
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create random sentences out of a list of words

    Unfortunately I don't have much experience using VBA so if you could give me more details, that would be great. Thank you.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to create random sentences out of a list of words

    No VBA. Open Word, paste that exact string, and press Enter.

  8. #8
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: How to create random sentences out of a list of words


  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to create random sentences out of a list of words


  10. #10
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: How to create random sentences out of a list of words

    Hi Morach
    try this macro
    it creates random numbers of 'sentences' within all the selected cells

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-07-2013
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: How to create random sentences out of a list of words

    Hi Nicky

    I've just tested the macro and it works great Thank you very much for your help.

    Have a nice day!

+ 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 manage number of words in sentences?
    By emil9216 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-01-2013, 04:25 AM
  2. List out words from sentences
    By ap_naveen in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-21-2010, 06:58 AM
  3. How to create random words
    By excelgenius in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2009, 05:49 AM
  4. Split sentences into words
    By sparx in forum Excel General
    Replies: 5
    Last Post: 02-22-2006, 03:51 PM
  5. counting specific words:unique sentences
    By jen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-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