ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculation not working????????????? (https://www.excelbanter.com/excel-discussion-misc-queries/211641-calculation-not-working.html)

Tdp

Calculation not working?????????????
 
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

FSt1

Calculation not working?????????????
 
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
"Tdp" wrote:

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


Don Guillett

Calculation not working?????????????
 
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

"Tdp" wrote in message
...
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



Tdp

Calculation not working?????????????
 
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)
--
Tdp


"Don Guillett" wrote:

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

"Tdp" wrote in message
...
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





All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com