Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with UserForm textbox code
I thought I posted this question last Friday. But, I can't find it.
Maybe I didn't actually finish posting it..... I have deigned a UserForm that will allow the user to enter some info that will be copied to a worksheet when the user clicks the OK button. There are about a dozen fields the user will enter info to. I have code that will look at the textbox1 entry, and compare it with the data already in column J of this list, and warn the user if this data already exists.. This works fine, except that I would like it to identify this duplicate as soon as the user tabs out of textbox1. Right now, it will perform this check only after the OK button is clicked, when the whole UserForm is completed. I'd like to save the user from entering in all the data that will not be copied to the list anyway. Here is the current code to perform the check to find a duplicate when it compares the textbox1 entry vs entries in column J of the worksheet: With Worksheets("Official list") If Application.CountIf(.Range("j:j"), TextBox1.Text) 0 Then MsgBox "This PO/PL is already on the list. Please edit the existing record " TextBox1.Text = Clear Else Range("J65536").End(xlUp)(2).Select Application.Selection.Value = TextBox1.Text End If End With Thanks for your help/suggestions. J.O. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TEXTBOX in USERFORM | Excel Programming | |||
userform textbox | Excel Worksheet Functions | |||
Adding TextBox to UserForm via code | Excel Programming | |||
Textbox in userform | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |