Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

timed loop in excel

Posted on 2013-06-21
6
Medium Priority
?
209 Views
Last Modified: 2013-06-21
Hi,

I have the following code:
private sub Workbook_Open()

do while f <> 100

application.ontime now + timeserial(0,0,5) , "test"

loop

end sub

sub test()
x = x +1
sheet1.cells(x,1).value = x + 2

end sub

Open in new window


I want to run this code in the background while i do other things in my workbook, but this code freezes all the worksheets and the workbook, what i can do? How i can run codes in the background while modifying part of the worksheet?
0
Comment
Question by:joyacv2
  • 3
  • 3
6 Comments
 
LVL 31

Expert Comment

by:gowflow
ID: 39266523
for sure

What is f ?
where do you put your code test in a module or where ?
x in test is declared in a module as the way you posted the code each time test starts x = 0 is this what you want ???

and most of all your missing doevents reason why the whole thing freezes but still ur code does not make sense as f is not initialized somewhere else.

Best is to say what you want then will put the code for you.
gowflow
0
 
LVL 1

Author Comment

by:joyacv2
ID: 39266542
f is a variable that nevers reach 100, so the loop is forever,
test is in a module
x starts at 0

What and where is necessary the doevents?
0
 
LVL 1

Author Comment

by:joyacv2
ID: 39266546
the code will modify part of the sheet while the user is changing other parts of the sheet
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 31

Accepted Solution

by:
gowflow earned 2000 total points
ID: 39266618
I made up a sample for you try it just use intuition

let me know your comments.
gowflow
ontime.xls
0
 
LVL 1

Author Closing Comment

by:joyacv2
ID: 39266635
works excellent, and give me a lots of ideas!!!, Thanks!!!
0
 
LVL 31

Expert Comment

by:gowflow
ID: 39267038
your welcome my pleasure glad I could help.
gowflow
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

926 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