Selasa, 07 Oktober 2014

Vedr: Vedr: Vedr: [ExcelVBA] Preventing keyboard use before userform shows


Thanks Dave! I have lost track of all solutions and I'm afraid my workbook contains so many subs now that they may conflict with each other.
I have made a very simple workbook-file with just your solution. I hope I can get some help from one of the moderators to post it to the group.

I hope you will be able to have a look at it.

When trying your solution, the keyboard input entered when the sound plays appear in the textbox when the userform shows! :(


Den Lørdag, 4. oktober 2014 22.12 skrev " [ExcelVBA]" <>:


I've lost track of what has been suggested, but the following seems to work for me Excel 2003)

Set your UserForm.Tag="NG"
Make sure that the TagIndex for your TextBox is not 0

In the TextBox_Change() sub, add this code:
    If Me.Tag = "NG" Then
        Me.tx1.Text = ""
        End If

In the TextBox_Enter() sub, add this code:
    Me.Tag = "OK"

Dave Gathmann


Posted by: Torstein Johnsen <>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (18)
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: to enter the ezine, then search the ARCHIVES for EXCEL VBA.

Visit our ExcelVBA group home page for more info and support files:

More free tutorials and resources available at:




Tidak ada komentar:

Posting Komentar