Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default time delay refresh on random number

Is it possible to have a time delay on a random number. For example the
random number refresh every x seconds.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default time delay refresh on random number

Read this:
http://www.cpearson.com/Excel/OnTime.aspx


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Bertrand" wrote:

Is it possible to have a time delay on a random number. For example the
random number refresh every x seconds.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default time delay refresh on random number

Bertrand,

You could use the OnTime method to fire a macro that writes the random
number to a cell or a variable once every six seconds or so. Run Random6
once manually, and it will keep going until you decide to stop it. I have
chosen a 2 digit random number between 0 and 100 - you can change that
easily.

Dim DT As Date

Sub Random6()
DT = Now() + TimeValue("00:00:06")
Application.OnTime DT, "Random6"
Cells(Rows.Count, 1).End(xlUp)(2).Value = Round(Rnd() * 100, 2)
End Sub

Sub StopIt()
Application.OnTime DT, "Random6", , False
End Sub

To stop it, use StopIt


HTH,
Bernie
MS Excel MVP


"Bertrand" wrote in message
...
Is it possible to have a time delay on a random number. For example the
random number refresh every x seconds.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i refresh random numbers on windows vista jhead Excel Discussion (Misc queries) 3 February 27th 08 05:31 PM
Time delay in displaying charts & chart names hjs40 Charts and Charting in Excel 2 October 21st 07 08:55 PM
Time Delay for Macros [email protected] Excel Discussion (Misc queries) 1 May 15th 07 02:42 PM
Long Time Delay To Paste From UserForm To Sheet Minitman Excel Worksheet Functions 7 December 6th 05 12:30 AM
How do I find random number in list of random alpha? (Position is. jlahealth-partners Excel Discussion (Misc queries) 0 February 8th 05 05:31 PM


All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"