I think your code would have worked OK had it been on one line or you used a
continuation character which is a space and an underscore _
However, you may like this better. Don't think you need to turn off
calculation for this one item
Private Sub SpinButton2_Change()
'Application.Calculation = xlCalculationManual
With Worksheets("Sheet4")
.Range("BY7").Value = SpinButton2.Value
.Range("BY6").Value = _
(.Range("BY2") - .Range("BY7")) * 28
End With
'Application.Calculation = xlCalculationAutomatic
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Tdp" <(E-Mail Removed)> wrote in message
news:CC20C656-8CF7-4B39-8366-(E-Mail Removed)...
>I have the following code. The trouble is that it is not calculating the
>sum.
> The figure in cell BY7 is not changing...................Any ideas??
>
> Private Sub SpinButton2_Change()
> Application.Calculation = xlCalculationManual
> Worksheets("Sheet4").Range("BY7").Value = SpinButton2.Value
> Worksheets("Sheet4").Range("BY6").Value =
> ((Worksheets("Sheet4").Range("BY2") - Worksheets("Sheet4").Range("BY7")) *
> 28)
> Application.Calculation = xlCalculationAutomatic
> End Sub
>
> ps: There is a textbox that is linked to cell BY7. It just displays the
> value by code.
> --
> Tdp