View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ozgrid.com ozgrid.com is offline
external usenet poster
 
Posts: 464
Default REARRANGE STRINGS IN ARRAY !!!!

Hi Jay

This should get you started;

Sub Test()
Dim str
Dim lValue As Long, lValue2 As Long


str = Array("one", "two", "three", "four", "five", "six")

lValue = 0
lValue2 = Int((5 * Rnd) + 1)

str(lValue) = Choose(lValue2, "one", "two", "three", "four", "five", "six")
MsgBox str(lValue)
End Sub



--
Regards
Dave Hawley
www.ozgrid.com
"jay dean" wrote in message
...
Hello -

I have 2 questions:

1. Array Str()is a 1 x 1 array containing strings. How do I randomly
rearrange the token positions? For example: if Str(0)= Ty, Str(1)=Jo,
Str(2)=Ba ... Str(ubound(Str))=Zo, then after running the code, the
tokens will have different indexes where for example, Str(0) will now
contain Ba, Str(1)=Ty...etc

2. If I already have Excel 2003 installed on my PC, will installing
Excel 2007 "over" the 2003 cause any issues with my older files compiled
in Excel 2003?

Thanks
Jay



*** Sent via Developersdex http://www.developersdex.com ***