VBA/Excel/Access/Word/Data Type/Single

Материал из VB Эксперт
Перейти к: навигация, поиск

Display in a message box the number of seconds passed since midnight.

   <source lang="vb">

Sub timerDemo()

   Dim seconds As Single
   seconds = timer
   MsgBox (seconds)

End Sub

</source>
   
  


Do Until... Loop Loops with Single value

   <source lang="vb">

 Sub Lottery_1()
     Dim sngWin As Single
     Do Until sngWin > 2000
         sngWin = Rnd * 2100
         Debug.Print sngWin, , "Lottery"
     Loop
 End Sub
</source>
   
  


Save random value to Single data type variable

   <source lang="vb">

 Sub Lottery_1()
     Dim sngWin As Single
     Do Until sngWin > 2000
         sngWin = Rnd * 2100
         Debug.Print sngWin, , "Lottery"
     Loop
 End Sub
</source>