943,724 Members | Top Members by Rank

Ad:
Aug 9th, 2008
0

stumped random character generator

Expand Post »
VBA so that each click generates a random character between A and Z in cell A1, and the number is displayed with a random font size in the range of 16 to 24 points.

can anyone help me out??
Reputation Points: 10
Solved Threads: 0
Newbie Poster
herephishy is offline Offline
9 posts
since Aug 2008
Aug 9th, 2008
0

Re: stumped random character generator

try using the ascii character map, ie chr(65) is A

find the table below
http://www.asciitable.com/

then use then randomize, and then the rand command to be able to pick a random character between the range that you require.

By memory it is rand(high-low)-low
try the below. (there might be a couple of errors as I haven't done VBA for a while)

vb Syntax (Toggle Plain Text)
  1.  
  2. randomize
  3. randomcharacter = rand(90 -65)-65
  4. range("A1") = chr(randomcharacter)
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
bushman_222 is offline Offline
65 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Do you have any shortcut..
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: API function in Visual Basic





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC