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.
0
Utf
1/26/2010 9:40:06 PM
excel.worksheet.functions 4936 articles. 2 followers. Follow

2 Replies
1218 Views

Similar Articles

[PageSpeed] 41

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.
0
Utf
1/27/2010 12:46:01 AM
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" <Bertrand@discussions.microsoft.com> wrote in message 
news:E36F9718-B7AD-462D-BA1C-F4035E6EC96C@microsoft.com...
> Is it possible to have a time delay on a random number.  For example the
> random number refresh every x seconds. 

0
Bernie
1/27/2010 1:00:25 AM
Reply:

Similar Artilces:

Sequential Numbering in Word 2003 and Recycling unused numbers
Once again, I am stuck in Macro world which is quickly consuming me :) It is though, quite addictive and I am determined to win the fight I'm having with my PC. I work for a company which uses network servers so the document needs to be accessed by different people but not necessarily at the same time. We operate Windows XP Word 2003. I am trying to create a document that will open with a sequential number, but if the document is not used or opened accidentally then the number it has generated needs to be recycled for auditing purposes. I seem to be able to get the number t...

Case numbering 01-26-04
I have found the auto numbering in 1.2, but it only lets me change the prefix for the cases "CAS". I need to start my numbering at 3500 instead of 1000. Is there a way to change the starting number? Thanks, Stefanie ...

how do Ii remove the grey page numbers in a work sheet
how do Ii remove the grey page numbers in a work sheet Try going to the View menu and unchecking Page Break Preview On Wed, 2 Feb 2005 11:01:08 -0800, "parker1230" <parker1230@discussions.microsoft.com> wrote: >how do Ii remove the grey page numbers in a work sheet You may be in page break preview mode. Go to "View" and select "normal" Regards Bill K "parker1230" <parker1230@discussions.microsoft.com> wrote in message news:5A65FC73-CAA0-428D-8ECD-0C2A2E15B799@microsoft.com... > how do Ii remove the grey page numbers in a work she...

Daylight Savings Time Changes
Hello, Does anyone know if the patch for Exchnage 2003 identified in KB926666 has to also be applied to every server that is running the Exchange Tools (System Manager)? Thanks in advance K On Wed, 31 Jan 2007 10:24:03 -0800, Kerry <Kerry@discussions.microsoft.com> wrote: >Hello, > >Does anyone know if the patch for Exchnage 2003 identified in KB926666 has >to also be applied to every server that is running the Exchange Tools (System >Manager)? > >Thanks in advance >K Im all for consistency. If the patch isnt needed, it shouldnt install, so I would at ...

How to you selectively sum on a series of numbers?
I have a column filled with numbers, but I only want to sum up a few of them. Let's say I have numbers filling A1:A10. Let's say I only want to sum up the numbers located is A3 and A4. I'd like to ability to enter something in the b column (e.g. "y" in cells b3 and b4) and have a formula that adds up the values in the "A" cells that have a corresponding "y" in the "B" column. This formula would allow me to selectively choose which cells needs to be summed. What is the best/cleanest way to write that formula? Thank you. =SUMPRODUC...

How do I reduce the number of data points I have??
Hi , I have some 10000 data points from which I need to reduce to something like 100 points before making an xy chart. Typically I would like to make a chart of every 10th point. So basically I need to reduce the length of my two rows. Is there any way I can do this easily?? Any help is highly appreciated. Thanks in advance -- swapan From the Microsoft Charting FAQ: http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=209#jon024 - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ ssan...

Automatic number fill-in on Labels
Is it possible to have word automatically fill in a series of numbers on Labels. I need a set of labels, counting by fives, from 1 to 3500. Just wishing I didn't have to key in every number....0001-0005, etc. See http://www.gmayor.com/Numbered_labels.htm. -- Stefan Blom Microsoft Word MVP "Bridgett" <Bridgett@discussions.microsoft.com> wrote in message news:9D380870-FF28-4227-B724-301AC3EC9A8D@microsoft.com... > Is it possible to have word automatically fill in a series of numbers on > Labels. I need a set of labels, counting by fives, from 1 ...

converting from text to numerical number
I have a spread sheet of entire year schedule. The format as following: 1 2 3 .... 31 row 1 row 2 row 3 Jan row 4 row 5 Feb row x Dec I would like to replace column 1 up to Jan to 1. Replace the cell below Jan to Feb to 2. etc. Would anyone help. Thanks in advance. You could select cells A1:A3, type a 1, then press Ctrl+Enter Select A4:A5, type a 2, and press Ctrl+Enter And so on, till all twelve months are done. james wrote: > I have a spread sheet of entire year schedule. The format as following: > > 1 2 3 .... 31 &...

Running macros for different cells at the same time
Hi all, Is it possible to run different macros on different cells at the sam time? If so how do I go about setting it up? Cheers Michae -- Message posted from http://www.ExcelForum.com Hi not really sure what you're trying to do. Could you give an example? -- Regards Frank Kabel Frankfurt, Germany > Hi all, > > Is it possible to run different macros on different cells at the same > time? If so how do I go about setting it up? > > Cheers > > Michael > > > --- > Message posted from http://www.ExcelForum.com/ Yes it is possible to run different m...

Outlook locks up all the time
This is a shot in the dark. Ever since getting my new Thinkpad with Windows XP, Outlook has never seemed to work properly. I've run diagnostics on my machine and nothing comes up as a problem. I've installed a spyware program because after talking to IBM tech support, they suggested I try that. I also talked to another support tech, who suggested I reinstall Windows completely. I'm not a real technical person. Won't a re-install wipe out my files? Most of the time that I use Outlook for my email, it slows down and eventually locks up. When I restart my computer,...

randomly scatter text
I have pub. 2003, I need to know how to take a phrase and randomly scatter it allover the page, with out placing it manually. I was able to do it on the last version of publisher but I can't seem to find the random button on this one. PLEASE HELP!!! Tabs? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "jenice" <jenice@discussions.microsoft.com> wrote in message news:C2C51271-D425-4E3E-8A71-55365A05D774@microsoft.com... >I have pub. 2003, I need to know how to take a phrase and randomly scatter it > all...

Converting a number to Hour & Min format
I am attempting to take a basic number, say 2000, and convert the number into an hour and minute format (i.e. 33:33) only. Everytime I use the custom format tab or the time/date tab I get a date included or an AM/PM setting. Any ideas or suggestions? Thanks in advance. Hi, For any number to be converted into time format you need to divide tha number by 24, since Excel time code is 24 (hr) code. then you forma the divided answer (83.33) into time, you will get 8:00 regards sazi -- Message posted from http://www.ExcelForum.com Use Format/Cells/Number/Custom [hh]:mm In article <...

Label of Number in a Range
I have set a high and low range of values with a correponding label, how do I return the label of the range where the data point fits? For example, ColA ColB ColC 5 10 Low 11 20 Medium 21 30 High D1 has the value 13 how do I get E1 to return the label "Medium" Thank you Hi Try: =VLOOKUP(D1,A2:C4,3) -- Andy. "webnntp" <webnntp@yahoo.com> wrote in message news:d1d35423.0405120719.7be94baa@posting.google.com... > I have set a high and low range of values with a correponding label, > how do I return the label of the range where the data point ...

Text Function with Different Formatting for Number
I'm trying to use a text function where I reference a number from another cell but I need the text part to be bold and the number not to be bold. This is the formula I'm using right now: ="Sales: "&TEXT(A16,"$#,##0_);($#,##0)") Unfortunately, excel won't let me just make the text bold without making the number bold. Anyone have any suggestions? Thanks M, I think a macro could do this, since it's really a string you're going to wind up with. But if you can put the Sales: part in a separate cell, life will be much easier anyway. then you ...

length of lot number
increase the amount of characters in the lot number field. current field length is not ample space to adequately describe lots in our organization. Length of the item description was increased to 100. In our case, lots are as important as items. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agre...

How do I convert a time format to a double
I use a function to calculate the hours worked based on time 12:00pm to 4:00pm is 4.0 hours when I get the number for hours worked it is in time format / .27398237 I need the number 4 so that I can do my calculation. How do I convert it to a number? Multiply with 24 and format as general -- Regards, Peo Sjoblom "DMB" <DMB@discussions.microsoft.com> wrote in message news:552FAD83-E8D4-4573-B9FF-613DDD259C22@microsoft.com... > I use a function to calculate the hours worked based on time > > 12:00pm to 4:00pm is 4.0 hours > > when I get the number for hou...

Vertical page numbers in a graph
I need to add vertical page numbers under page setup when printing a graph. Has anyone done this before? I definitely want it out of the graph area. Thanks - I don't understand the problem -- and I suspect a similar reason has stopped others from responding. If you set up a page number in the page header, it is not part of the chart area. In addition, after setting up the page information in the header, switch to Print Preview mode and click the margins... button. XL has a neat graphical way of adjusting various page borders/margins. -- Regards, Tushar Mehta, MS MVP -- E...

Random Blank Subjects/Messages
When I open my hotmail from outlook connector, there seems to be some blank subjects, with blank messages. When I go online through hotmail, these items are NOT there. The problem does not happen every day, but it does happen enough to make it quite challenging to get through e-mails. Any suggestions? I have already removed the account from connector and re-added it... I appreciate your help!! If your antivirus or security software scans incoming email, the email integration feature should be uninstalled (preferred) or disabled. Installing the OLC Beta should fix the blan...

Ticket Numbering
I need to make 200 numbered tickets. I can design the ticket but how do I design them that they print with consecutive numbers? regards, "nobody" You will have to setup a data base with your numbers then do a mail merge. When you do a merge you can only have one ticket on your screen. Select multiple pages per sheet in the print setup. There is help here: http://office.microsoft.com/en-us/publisher/CH100502901033.aspx -- Mary Sauer http://msauer.mvps.org/ "nobody" <nobody@nowhere.com> wrote in message news:OsyqzgcxKHA.3304@TK2MSFTNGP...

transaction number in PC Charge
Is there any way to manage the fields that should go to PC Charge while tendering credit cards in RMS. The problem is that transaction number ( called Ticket in PC Charge) doesn't appear in PC Charge and that cost as extra money. Regards, Ewa ...

TIME function used in Excel
I'm new to these newsgroups, so I apologize if my etiquette is not appropriate. I'm trying to help a friend whose computer was recently replaced. In his new computer, his custom macro will not run. He gets a "Microsoft Visutal Basic Compile error: Can't find project or library" with the TIME function highlighted. I first suggested using the NOW or DATE function, but he said it creates an additional series of errors. I also tried installing 'Windows Script 5.6' to no avail. Any suggestions on how to get this TIME function to work? Thank you in advance for ...

How can I superscript numbers greater than 3?
I need to add footnotes to an Excel spreadsheet. I found the numbers 1 thru 3 in the insert symbols menu, but I need many more numbers subscripted. Can anyone help? Try Format, Cells, font, effect (superscript, subscript) Carole O "Caseybay" wrote: > I need to add footnotes to an Excel spreadsheet. I found the numbers 1 thru 3 > in the insert symbols menu, but I need many more numbers subscripted. Can > anyone help? Thanks so much, Carole! That's perfect for what I want. I must have seen that dialog box a million times but never related it to what I needed in t...

Date and Time formular
I'm trying to take one date and time away from another but having a problem fathomining it out eg 01.04.2008 10:55:27 - 01.04.2008 9:37:13 The date and time are in the same cell eg 01.04.2008 10:55:27 is in A1 A formula for this would be great if anyone has one to hand Thanks Just subtract =End_Time-Start_Time -- Regards, Peo Sjoblom "SS" <Student.2@uk.bosch.com> wrote in message news:g0hgsk$jgc$1@news4.fe.internet.bosch.com... > I'm trying to take one date and time away from another but having a > problem fathomining it out > > eg >...

Date and Time #2
I see how that NOW() function works but is it possible to display only the time and not the date? Nick Use now(), then format the cell to only show time format=>Cells=>Number Tab, select time and pick a format. -- Regards, Tom Ogilvy Lord Of The Morning <Not@aol.com> wrote in message news:vmjrr6dsduv569@corp.supernews.com... > I see how that NOW() function works but is it possible to display only the > time and not the date? > Nick > > Yes, with TIME you'll get only the (current) time "Lord Of The Morning" <Not@aol.com> wrote in message...

in VBA how to retreive cell values 1 byte at a time?
How would I write VBA to retrieve (get at) the value in a cell byte by byte from its natural form? i.e. no conversions are to be performed. E.g., if a string, then I may get more bytes than for a number. Thanks. Penny, If the cell contains text, you can retrieve characters (bytes) with the MID function. =MID(A2, CharPosition, 1). You can get the actual byte values with the CODE function =CODE(MID(A2, CharPosition, 1)). If a number, you can extract the decimal digits of the number in the same way, but you're not getting actual bytes (as stored by Excel). Excel stores numbers in ...