Solved

timed loop in excel

Posted on 2013-06-21
6
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
LVL 31

Accepted Solution

by:
gowflow earned 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

617 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