+ Reply to Thread
Results 1 to 5 of 5

Error validating a inputbox with regular expressions

  1. #1
    Registered User
    Join Date
    05-12-2021
    Location
    México
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (16.0.13530.20054)
    Posts
    17

    Error validating a inputbox with regular expressions

    Dear experts:

    Hope you are having a great week!

    I'm having a hard time validating the information provided on an inputbox, it must be an email from the outlook domain. This is the code I'm using to evaluate the email provided (ROemail)

    Please Login or Register  to view this content.
    The Function ValidateEmailAddress() that validates the String goes like this:

    Please Login or Register  to view this content.
    But for some reason it's not working and it's sending me this errors related to the objRegExp, It's the first time using a function and a Regular Expression so I'm not sure if I'm doing something wrong or something is missing.

    Could you please advice me?

    Thank you so much in advance!
    Attached Images Attached Images
    Last edited by Magmarinita; 06-25-2021 at 05:52 AM.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Error validating a inputbox with regular expressions

    You omitted the line where you create the object;

    Please Login or Register  to view this content.
    i.e. insert this line before your 'error line'.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,652

    Re: Error validating a inputbox with regular expressions

    It may be easier to use the Like operator to validate...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    05-12-2021
    Location
    México
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (16.0.13530.20054)
    Posts
    17

    Re: Error validating a inputbox with regular expressions

    @Croweater thank you so much! Just what I needed!

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Error validating a inputbox with regular expressions

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Regular Expressions in VBA
    By BS Singh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 03:29 PM
  2. Regular Expressions in VBA
    By samualt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-08-2011, 11:34 PM
  3. VBA . validating user entered data (via inputbox) and error handler
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2011, 05:54 PM
  4. Regular Expressions
    By mattdick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2009, 06:33 PM
  5. [SOLVED] Regular expressions
    By JeffMelton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2006, 09:00 PM
  6. [SOLVED] Error while Checking for Regular Expressions Library in VBA
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2005, 06:05 PM
  7. [SOLVED] Regular Expressions in VBA?
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-10-2005, 02:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1