calendar spinbutton
Hi,
Am Thu, 27 Nov 2014 15:32:49 +0000 schrieb Avexon:
Hello, I make 100 years calendar and i want month and year change with
active x spinbutton. in cell "B4" is number of month (1 to 12) and in
cel "H4" is year. one spin buton for month change and one for year
change. if in cell with month (B4) is 12 and i click to spin up (for
month) i want to jump to 1 (not to 13) and year (in cell h4 ) +1 and if
i click to spin down and in cell "b4" is 1 i want to jump 12 (not to 0)
and decrease year by 1 ("h4")-1
in properiy window for the spinbutton set min to 0 and max to 13 and
linked cell to Sheet1!B4:
Private Sub SpinButton1_SpinDown()
With ActiveSheet
If .SpinButton1 < 1 Then
.SpinButton1 = 12
.Range("H4") = .Range("H4") - 1
End If
End With
End Sub
Private Sub SpinButton1_SpinUp()
With ActiveSheet
If .SpinButton1 12 Then
.SpinButton1 = 1
.Range("H4") = .Range("H4") + 1
End If
End With
End Sub
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|