stumped random character generator

Reply

Join Date: Aug 2008
Posts: 9
Reputation: herephishy is an unknown quantity at this point 
Solved Threads: 0
herephishy herephishy is offline Offline
Newbie Poster

stumped random character generator

 
0
  #1
Aug 9th, 2008
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??
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 65
Reputation: bushman_222 is an unknown quantity at this point 
Solved Threads: 4
bushman_222's Avatar
bushman_222 bushman_222 is offline Offline
Junior Poster in Training

Re: stumped random character generator

 
0
  #2
Aug 9th, 2008
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)

  1.  
  2. randomize
  3. randomcharacter = rand(90 -65)-65
  4. range("A1") = chr(randomcharacter)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC