Excel Macro Help

Neverland

New Member
Joined
Apr 20, 2010
Messages
8
Hi,

I was wondering if someone could help me out. I have an excel macro which is a clock/timer. The only problem is that whenever I change any cell in the spreadsheet, it seems to stop the clock.

I am looking to introduce a solver which runs continuously, while leaving the clock running at the same time. Would it be better to use the solver or to create an iteration based macro?

Does anyone have any idea how I'd code it? Im not the most experienced at this type of thing!

Thanks a lot
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I just got this from a website, copied and pasted, and it worked.


Sub stopwatch()
'Seconds and fractions of seconds Timer!
Dim Start, Finish, TotalTime

'Set timer.
Start = Timer
StopSW = False
ReSetSW = False
myTime = Sheets("Controls").Range("AA1").Value
Sheets("Controls").Range("e12").Select

myStart:
'Yield to other processes.
DoEvents
'Calculate time.
Finish = Timer
TotalTime = Finish - Start
'Show time on sheet!
Sheets("Controls").Range("e12").Value = Format(myTime + TotalTime, "0")
'Test for "ReSet or Stop!"
If ReSetSW = True Then
Sheets("Controls").Range("e17").Value = 0
Sheets("Controls").Range("AA1").Value = 0
StopSW = True
End If
If Not StopSW = True Then
Sheets("Controls").Range("AA1").Value = TotalTime
GoTo myStart
End If
End
End Sub



Im looking to run that clock while solving an equation which changes cells A10, A11, A12 until B1 reaches its minimum value.
 
Upvote 0

Forum statistics

Threads
1,216,933
Messages
6,133,601
Members
449,819
Latest member
belowram

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top