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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

timed loop in excel

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
joyacv2
Asked:
joyacv2
  • 3
  • 3
1 Solution
 
gowflowCommented:
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
 
joyacv2Author Commented:
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
 
joyacv2Author Commented:
the code will modify part of the sheet while the user is changing other parts of the sheet
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gowflowCommented:
I made up a sample for you try it just use intuition

let me know your comments.
gowflow
ontime.xls
0
 
joyacv2Author Commented:
works excellent, and give me a lots of ideas!!!, Thanks!!!
0
 
gowflowCommented:
your welcome my pleasure glad I could help.
gowflow
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now