Hello,
I recently received assistance from the community on how to code two separate command buttons to give a TextBox a value of +1 or -1. Thank you. The code suggested are:
and![]()
Private Sub CommandButton2_Click() If Me.TextBox75.Value = 0 Then Me.TextBox1.Value = 0 Else Me.TextBox75.Value = Me.TextBox75.Value - 1 End If End Sub
However, as I continue to deign the UserForm1 I have more than a dozen Textboxes that require a set of command buttons to do the same +/- event. Not only does the form start looking cluttered but coding can get tedious. My question is: can someone suggest a code(s) that will allow one set of command buttons - commandbutton (+1) and commandbutton2 (-1) - that will affect more than one textbox1-12 WHEN the textbox "gets focus" from a mouse event (click).![]()
Private Sub CommandButton3_Click() Dim oldvalue As Double oldvalue = Me.TextBox75.Value Me.TextBox75.Value = oldvalue + 1 End Sub
Thank you - Gal403
Bookmarks