E
Edwin Verwer
I have a userform with a spinbutton and a textbox.
Every time i press the spinbutton focus is set to the spinbox and little
squares apear in the up and down buttons of the spinbutton.
I want to set the focus back to the textbox so that those squares aren't
there anymore.
I have used the following code:
-----------------------------------------------
Private Sub spinbutton_SpinDown()
If userform.textbox.Value <> 1 Then userform.textbox.Value =
userform.textbox.Value - 1
End Sub
Private Sub spinbutton_SpinUp()
userform.textbox.Value = userform.textbox.Value + 1
end sub
--------------------------------------------------
I have already tried putting the code.
userform.textbox.setfocus at the end of the spinup and spindown effent.
but then the first time i press the spinbutton he wil set focus to the
spinbutton the next time the focus wil be put to the textbox and so the focus
switches everytime.
Is there a way to simply set focus to the textbox after he is done raising
the value of the textbox?
Every time i press the spinbutton focus is set to the spinbox and little
squares apear in the up and down buttons of the spinbutton.
I want to set the focus back to the textbox so that those squares aren't
there anymore.
I have used the following code:
-----------------------------------------------
Private Sub spinbutton_SpinDown()
If userform.textbox.Value <> 1 Then userform.textbox.Value =
userform.textbox.Value - 1
End Sub
Private Sub spinbutton_SpinUp()
userform.textbox.Value = userform.textbox.Value + 1
end sub
--------------------------------------------------
I have already tried putting the code.
userform.textbox.setfocus at the end of the spinup and spindown effent.
but then the first time i press the spinbutton he wil set focus to the
spinbutton the next time the focus wil be put to the textbox and so the focus
switches everytime.
Is there a way to simply set focus to the textbox after he is done raising
the value of the textbox?