+ Reply to Thread
Results 1 to 6 of 6

Userform for canadian postal code validation?

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Userform for canadian postal code validation?

    Hi,

    I would like to know how to validate if a textbox is entered, if and reach condition, then that postal code will be move to another textbox2:
    If TextBox1 = LETTER NUMBER LETTER SPACE NUMBER LETTER NUMBER Then
    TextBox2 = TextBox1
    Else
    MsgBox ("THis is not a valid canadian postal code")

    Can anyone help on this?

    Thanks.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Userform for canadian postal code validation?

    perhaps

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Userform for canadian postal code validation?

    that works, but how if I want to integrate an right(textbox1.text),7?
    Example:

    If entered more string in the textbox1, it will only capture the last 7 string and from there it does the validation.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Userform for canadian postal code validation?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Userform for canadian postal code validation?

    Nice, I made a mistake in it by adding the ,7 after the bracket, thats why it didnt work.

    THank you so much!

  6. #6
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Userform for canadian postal code validation?

    1 last question regarding this. How can I delete it then?

    Please Login or Register  to view this content.
    Delete this part?

    ** NEVERMIND ***
    Last edited by calvinle; 06-01-2014 at 01:19 PM. Reason: figure out already.

+ 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. Format Canadian Postal Code on Entry
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 03-24-2019, 04:20 PM
  2. [SOLVED] Help With Canadian Postal Code In Userform
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-04-2013, 08:16 PM
  3. Distance between Canadian Postal Codes
    By lesleyhollett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-17-2013, 10:47 AM
  4. [SOLVED] Format for Canadian Postal Codes
    By rmcc in forum Excel General
    Replies: 25
    Last Post: 07-24-2012, 02:04 PM
  5. Adding spaces to Canadian postal code
    By loren.silverman in forum Excel General
    Replies: 3
    Last Post: 03-01-2012, 10:02 PM

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