Sin Button run macro Excel 2000 - 2003

J

jfcby

Hello,

I put a worksheet toolbar Spinner Button on worksheet6 and my
reference cell is on worksheet2.
This code I put in worksheet6 module:

Private Sub SpinButton1_SpinUp()
Sheet2.Range("M4").Value = Sheet2.Range("M4").Value + 1
End Sub

Private Sub SpinButton1_SpinDown()
Sheet2.Range("M4").Value = Sheet2.Range("M4").Value - 1
End Sub

Then, I assigned this macro to the spin button using a general module:

Sub InDecreaseYear()
If Sheet2.Range("M4") = 1 Then
Call DateTesterBaselineIncrease
Call BuildCalendar_North
End If

If Sheet2.Range("M4") = 2 Then
Call DateTesterBaselineDecrease
Call BuildCalendar_North
End If

End Sub

This code will change the value in the cell from 1 to 2 and back to 1
but it will not run the macros to decrease the value it will only run
the macros to increase the value.

How can this code be changed when the spin button up is pressed those
macros will run and when pressed down those macros will run?

Thank you for your help,
jfcby
 

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