Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
make a sentence from words chosen at random
A1:A10 contains prepositions
B1:B10 contains adjectives C1:C10 contains nouns D1:D10 contains verbs Can I have a macro select one item at random from each range? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
make a sentence from words chosen at random
Hi DL,
This should help you: Sub GenerateSentence() Dim WordNumber As Integer Dim Sentence As String Dim c As Integer For c = 1 To 4 Randomize WordNumber = Int((10 * Rnd) + 1) Sentence = Sentence & Cells(WordNumber, c) & " " Next c MsgBox Sentence End Sub ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to copy the first word or two words from a cell containing a complete sentence to another cell | Excel Discussion (Misc queries) | |||
How to make a long sentence wordwrap | Excel Discussion (Misc queries) | |||
In excel, how do we pull the first letter from words in a sentence | Excel Worksheet Functions | |||
Not all words in sentence prints - row is set autofit HELP? | Excel Worksheet Functions | |||
How do I make Excel worksheet tabs change appearance when chosen . | Excel Discussion (Misc queries) |