I am trying to create a Calculator in excel VBA using a userform with two text boxes, I have just created the numpad and when I click on 1 for instance, it will input number 1 in text box 1 but when I select text box two and then select the number 1 again it will enter it back in text box 1 instead of text box 2 where my cursor was on. Anyone know how I can use something like setFocus or anything along those lines to enter the number in whatever textbox the cursor is set on, Thanks.
Private Sub CmdBtn1_Click()
txt_Num1.Value = txt_Num1.Value + "1"
End Sub
I am looking for for the number to be inputted into whichever text box the cursor was set on when the number is clicked.
