ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   verify user input (https://www.excelbanter.com/excel-programming/369955-verify-user-input.html)

danny_chev

verify user input
 
Hi
I have a very simple Infopath form in which the user types in their
name and id number, which will concatinate to show them what their user
name will be in another text box on the form.

We have a separate exel sheet with the pre-setup usernames.

I would like a bit of script to take the contents of the text box in
infopath and verify that the exel spreadsheet includes a cell with that
content and if it does, show a "succesful" message or if it doesn't
exist show a "try again" message to the user.

Does anyone have any suggestions please?

Thanks alot

Dan


Tom Ogilvy

verify user input
 
Dim v, res
v = "Valuetocheck"
res = application.Match(v,Worksheets("sheet1").Range("A1 :A500"),0)
if iserror(res) then
msgbox "No match"
else
msgbox "Match"
End if

--
Regards,
Tom Ogilvy


"danny_chev" wrote:

Hi
I have a very simple Infopath form in which the user types in their
name and id number, which will concatinate to show them what their user
name will be in another text box on the form.

We have a separate exel sheet with the pre-setup usernames.

I would like a bit of script to take the contents of the text box in
infopath and verify that the exel spreadsheet includes a cell with that
content and if it does, show a "succesful" message or if it doesn't
exist show a "try again" message to the user.

Does anyone have any suggestions please?

Thanks alot

Dan




All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com