Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Automatic refresh function by interval

Posted on 2014-08-20
8
Medium Priority
?
100 Views
Last Modified: 2014-08-21
EE Pros,

I'm doing testing on what needs to appear as "real time data" and statistics on different Sensors.  I need to start out easy on this so I have attached a spreadsheet that has a Column E that needs to be refreshed at a particular frequency (in seconds) -- perhaps set up as a simple looping exercise.  So when the sheet is open, it will automatically fire off the function to randomly produce new data at the frequency specificed.

Also, this change in the function should not update any other =randbetween( , ) calculations.
C--Data-Temp-Date-Time-Calculation.xls
0
Comment
Question by:Bright01
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:FamousMortimer
ID: 40276214
Hi,

Does this work for you?  You can change the code in TheSub to whatever you need it to do and change the variable cRunIntervalSeconds to the interval in number of seconds you want it to run.  Right now I just set it to calculate the activesheet which will recalc your random functions
0
 
LVL 24

Expert Comment

by:Bitsqueezer
ID: 40276221
Hi,

that can't be done with a function but you can use the "Workbook Open" event to start a timer using the "Application.OnTime" method (see Excel help for further details).

With this you can specify a VBA procedure which updates the wanted cell(s) to the wanted values at the given time and then it only needs to use the Application.OnTime method again to set the next interval (Now() plus 5 seconds).

Of course you would need to save the file as macro enabled file.

Cheers,

Christian
0
 
LVL 10

Expert Comment

by:FamousMortimer
ID: 40276229
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Bright01
ID: 40276703
FamousMortimer,

I downloaded the WS but there is no Sub.

B.
0
 
LVL 10

Accepted Solution

by:
FamousMortimer earned 2000 total points
ID: 40276713
0
 

Author Closing Comment

by:Bright01
ID: 40276806
FamousMortimer,

Thank you!  Great work!

B.
0
 
LVL 10

Expert Comment

by:FamousMortimer
ID: 40276857
You are very welcome.  Glad to help and thanks for the grade!
0
 

Author Comment

by:Bright01
ID: 40276936
I'm posting a version 2 request.  Hope you will pick it up!

B.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question