ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SpinButton Excel 2002 bug? (https://www.excelbanter.com/excel-programming/421529-spinbutton-excel-2002-bug.html)

Delfu

SpinButton Excel 2002 bug?
 
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?


stefan onken

SpinButton Excel 2002 bug?
 
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


On 19 Dez., 12:06, Delfu wrote:
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?




All times are GMT +1. The time now is 07:26 PM.

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