ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Random Text (https://www.excelbanter.com/excel-programming/290282-random-text.html)

pete

Random Text
 
I know we can randomally generate #s in excel VBA, but I
want to randomally select between text values.

Example if A1=Yes A2=No and A3=Maybe

I want a code that only looks at thses values and displays
one in cell B2. If I use the Randbetween formula function
I get the #Value error. because the formula is looking for
#'s

Is this possible?
Pete

Ken Wright

Random Text
 
Hardcoded:-

=CHOOSE(RANDBETWEEN(1,3),"Yes","No","Maybe")

Referenced:-

=CHOOSE(RANDBETWEEN(1,3),A1,B1,C1)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Pete" wrote in message
...
I know we can randomally generate #s in excel VBA, but I
want to randomally select between text values.

Example if A1=Yes A2=No and A3=Maybe

I want a code that only looks at thses values and displays
one in cell B2. If I use the Randbetween formula function
I get the #Value error. because the formula is looking for
#'s

Is this possible?
Pete



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 30/01/2004




All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com