Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Sin Button run macro Excel 2000 - 2003

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Sin Button run macro Excel 2000 - 2003

Hello,

Thank you for your help! The changes to hthe code works great!

jfcby

John Bundy wrote:
I plugged your code in and it worked fine, looks like you need to set up an
on change event and place your two pieces in there.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"jfcby" wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2000 Excel Macro runs very slow in 2003, why? The_Other_Mike Excel Discussion (Misc queries) 1 May 10th 06 04:36 PM
Simple Macro, works in Excel 2002, 2003 but won't work in 2000 DJA[_2_] Excel Programming 5 September 28th 05 05:10 PM
Excel 2000 v 2003 Macro & VBA Incompatibities Wboson Excel Programming 1 March 25th 05 10:40 PM
Excel 2000 v 2003 Macro & VBA Incompatibility Wboson Excel Programming 0 March 25th 05 09:13 PM
Assign macro to button in EXCEL 2003 Steffen Kuenstner Excel Programming 1 January 8th 04 11:04 AM


All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"