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! :(
Torstein
   Den Lørdag, 4. oktober 2014 22.12 skrev "dmgathmann@yahoo.com [ExcelVBA]" <ExcelVBA@yahoogroups.com>:
  
  Torstein,
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
        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 <sejohnse@yahoo.no>
| 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: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
  
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
  
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
  
----------------------------------
                       Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
.
  __,_._,___
      
Tidak ada komentar:
Posting Komentar