Hello Guys,
A am using a file which increments CELL L1 when i press the Run Button Which is on the Screen and Stops when i press the STOP BUTTON.
What i want is when i press the RUN BUTTON then a range of cells (for example (L1:L25) should be incremented rather then a single cell i.e. L1
Here is what i have (in a standard module)
And in the sheet code
Awaiting reply,
Humayun
A am using a file which increments CELL L1 when i press the Run Button Which is on the Screen and Stops when i press the STOP BUTTON.
What i want is when i press the RUN BUTTON then a range of cells (for example (L1:L25) should be incremented rather then a single cell i.e. L1
Here is what i have (in a standard module)
Public IsRunning As Boolean
Public KeepGoing As Boolean
Public Sub SolveIt()
Dim xlapp As Excel.Application
Dim ws As Worksheet
Dim UpdateRange As Range
Set xlapp = ActiveWorkbook.Application
Set ws = ActiveSheet
Set UpdateRange = ActiveSheet.Range("L1")
xlapp.DisplayStatusBar = True
IsRunning = True: KeepGoing = True
tests = UpdateRange
UpdateRange = tests
KeepLooping:
Do While KeepGoing = True
tests = tests + 1
UpdateRange = tests
ws.Calculate
Application.StatusBar = "# of iterations: " & tests
DoEvents
Loop
Set UpdateRange = Nothing
Set ws = Nothing
End Sub
And in the sheet code
Private Sub cmdRunIt_Click()
SolveIt
End Sub
Private Sub cmdStop_Click()
KeepGoing = False
End Sub
Awaiting reply,
Humayun