SpinButton Excel 2002 bug?

D

Delfu

Hi all. I got 2 sheets in the Sheet A i got a spin button and in Sheet B i
got some data.
These are my 3 routines. The first make the index for the SpiBtn. The second
and third are 2 events: SpinUp SpinDown. If i run the SpinUp and SpinDown
macro INSIDE the code, with debugger (F8 step to step) all works grate.

If i push my SpinButton, the routine is linked but dosn't produce anyeffect.

Index Maker:
=============================
Public Sub getposition()
Dim i As Integer

For i = 1 To 100
If Year(Date) = Worksheets("Mesi").Range("C" & i).Value _
And Month(Date) = Worksheets("Mesi").Range("A" & i).Value Then
Foglio1.SpinButton1.Min = 1
Foglio1.SpinButton1.Value = i
Foglio1.SpinButton1.Max = 100
Exit For
End If
Next
End Sub

===========================================
Events Down and Up.
===========================================
Private Sub SpinButton1_SpinDown()
Foglio1.SpinButton1.Value = Foglio1.SpinButton1.Value + 1
indice = Foglio1.SpinButton1.Value
If indice > Foglio1.SpinButton1.Max Then Exit Sub
Worksheets("Main").Range("H1").Value = "CALENDARIO SCADENZE MESE DI " & _
Worksheets("Mesi").Range("B" & indice).Value & " " &
_Worksheets("Mesi").Range ("C" & indice).Value
End Sub

=================================

Private Sub SpinButton1_SpinUp()
Foglio1.SpinButton1.Value = Foglio1.SpinButton1.Value - 1
indice = Foglio1.SpinButton1.Value
If indice < Foglio1.SpinButton1.Min Then Exit Sub
Worksheets("Main").Range("H1").Value = "CALENDARIO SCADENZE MESE DI " & _
Worksheets("Mesi").Range("B" & indice).Value & " " &_
Worksheets("Mesi").Range("C" & indice).Value
End Sub
===========================================
Any Help?
 
S

stefan onken

hi Delfu,
is the code for SpinDown/ Up in a standard codemodule?
it must be in the codemodule of sheet Foglio1 (rightclick on the tab/
show code).

stefan
 

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