AliWood
New member
- Joined
- May 1, 2020
- Messages
- 7
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Office365
Hello,
I have a VBA User Form with several numeric fields, with spin buttons against each one. I have SpinUp and SpinDown routines for each field and within these routines there is a mixture of code specific to the field and code that is common to all the Spin buttons (say to call a subroutine Update_figures). Is there a way of describing the buttons as a Class and holding the common code within the class? I am a beginner wrt the use of Classes but would like to learn more. Thank you.
Here's an example of one of the subroutines:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub SpnDueMonth_SpinDown()
If CDate(lblDueDate) - 30 >= CDate(lblRampDate) Then lblDueDate = UsualFormat2(CDate(lblDueDate) - 30): Update_figures Else Beep
End Sub
Many thanks[/FONT]
Ali
I have a VBA User Form with several numeric fields, with spin buttons against each one. I have SpinUp and SpinDown routines for each field and within these routines there is a mixture of code specific to the field and code that is common to all the Spin buttons (say to call a subroutine Update_figures). Is there a way of describing the buttons as a Class and holding the common code within the class? I am a beginner wrt the use of Classes but would like to learn more. Thank you.
Here's an example of one of the subroutines:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Private Sub SpnDueMonth_SpinDown()
If CDate(lblDueDate) - 30 >= CDate(lblRampDate) Then lblDueDate = UsualFormat2(CDate(lblDueDate) - 30): Update_figures Else Beep
End Sub
Many thanks[/FONT]
Ali