Hi.
I have a userform with 4 inputboxes. For one of them I want to compare the input to a range. This works. Then I have a loop that says if the input is not among the values (text and number) in the range, a variable gets a number. This works. If the input is not in the range, a message box says that the input does not exist, and returns to the userform. This works. BUT here is the strange part; I then want the .setfocus to be in the same textbox, but this does not happen? The next textbox is highlighted...I've tried several solutions, but can't fint the one???!!!
Here are the full codes to the userform;
Explanations:
formMastnummer is the textbox I'm talking about.
formFriksjonsvinkel_en is another textbox
formGrunnvannstand_en is another textbox
formOppfylling_en is another textbox
Beregningsinput_en is the userform.
I copied all the codes, maybe some of the other codes interfere with the one I want to work.
As you can see, I have setfocus in the same if sentence as the msgbox, (marked with <----- below), but .setfocus does not work, while the msgbox does...?
(Btw: no error code are displayed)
Thanks in advance!!!
Bookmarks