Hi everyone,
I'm a relative newbie at all this but I have created a user form where a specific numeric entry is required in column d. So I need a code that checks the database for this number to prevent duplicate entries however some of the time this number is not always available and will be entered at a later date by another update userform. Everytime I leave the cell empty it kicks up my validation. Is it possible to code to code something that ignores the blank entries?
My code is currently:
If application. Worksheet function. CountIF(sh. Range("d:d" ), me. Textbox3. Value) >0 then MsgBox "This number exists in DATABASE", vbcritical
Exit sub
End if
Thanks in advance
I'm a relative newbie at all this but I have created a user form where a specific numeric entry is required in column d. So I need a code that checks the database for this number to prevent duplicate entries however some of the time this number is not always available and will be entered at a later date by another update userform. Everytime I leave the cell empty it kicks up my validation. Is it possible to code to code something that ignores the blank entries?
My code is currently:
If application. Worksheet function. CountIF(sh. Range("d:d" ), me. Textbox3. Value) >0 then MsgBox "This number exists in DATABASE", vbcritical
Exit sub
End if
Thanks in advance