PC Review


Reply
Thread Tools Rate Thread

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

 
 
Tdp
Guest
Posts: n/a
 
      25th Nov 2008
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
 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      25th Nov 2008
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

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      25th Nov 2008
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


 
Reply With Quote
 
Tdp
Guest
Posts: n/a
 
      25th Nov 2008
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
> (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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working Day Calculation Vinod Chandramouli Microsoft Excel Discussion 3 17th Mar 2009 06:42 PM
Calculation not working =?Utf-8?B?TG9yaQ==?= Microsoft Access Form Coding 2 14th Aug 2007 02:50 PM
Calculation not working slpixie Microsoft Access Reports 2 15th Sep 2006 04:58 PM
Calculation not working Copper via OfficeKB.com Microsoft Excel New Users 4 22nd Feb 2006 09:11 PM
range.calculation with UDF not working when calculation is set to automatic Brian Murphy Microsoft Excel Programming 5 14th Oct 2003 07:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 AM.