Calculation not working?????????????

T

Tdp

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.
 
F

FSt1

hi
i don't work with spin buttons much but i do think it has to be linked to a
cell in order to show it's value which high, low and step values are set in
the spin button properite sheet.
is the spin button linked to BY7?
if so, it would see you have a round robin conflict.
where does the text box get it's value?

Regards
FSt1
 
D

Don Guillett

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
 
T

Tdp

Thanks to both of you for getting back so quick.
Don, I'm afraid it's still not working. The spinbutton does its job but cell
BY6 value does not change as you sin up or down.
Textbox1 = value of BY7
Textbox2 = value of BY6

As I spin up or down values in TB1 change but not TB2 nor on sheet4 (BY6)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top