View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Test if value is between two numbers

Just to add one more

Dim nMax as Long, nMin as Long, MyNum as Long
nMax = 51
nMin = 39
MyNum = int(rnd()*100+1)
if MyNum nMin and MyNum < nMax then


end if

--
Regards,
Tom Ogilvy


"smplogc" wrote in
message ...

What's the code to test if a value is between two numbers? I can easily
find the answer for other languages, but not VBA! TIA.


--
smplogc
------------------------------------------------------------------------
smplogc's Profile:

http://www.excelforum.com/member.php...o&userid=33887
View this thread: http://www.excelforum.com/showthread...hreadid=537603