I had a calculation performed on a spreadsheet which I transfered to Visual Basic, the spreadsheet performed calculation using a value derived using the goal seek function.

The code is now something as below:


TargetValue = 1500
arbval = -100000 ' this is intial value assumed as the goal seek value


Do While TotFlo <= TargetValue
Totflo = 0
For i = 1 To 365
SixFlow(i) = calculation performed using arbval and other variables
Totflo = Totflo + SixFlow(i)
Next i
arbval = arbval + 0.001

Loop

as you can see i increase arbval by 0.001 on each loop to put into the caculation trying to copy goal seek.

Can anybody suggest some code that would allow to decrease the processing time, arbval will be between -100,000 and 100,000

thanks in advance