+ Reply to Thread
Results 1 to 10 of 10

A validation need --- Excel VBA (Macros)

  1. #1
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Cool A validation need --- Excel VBA (Macros)

    *Always first two characters should be "V" and "-".
    *third character should be alphabetic.
    *last four characters should be numeric only.
    *The length should be seven.

    I need a validation like below example.

    e.g. V-B0004

    Thank you very much guys

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: A validation need --- Excel VBA (Macros)

    This formula gives you True if the 4 rules are true and False otherwise
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If you want validate the use of lowercase=uppercase you can use UPPER(A2) instead A2

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: A validation need --- Excel VBA (Macros)

    As you posted this in the excel macro section I'll post a macro solution as well

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Re: A validation need --- Excel VBA (Macros)

    If you do not mind attach the VBA file frnd pls

  5. #5
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Re: A validation need --- Excel VBA (Macros)

    Quote Originally Posted by ThiliSuper View Post
    If you do not mind attach the VBA file frnd pls
    Quote Originally Posted by Alf View Post
    As you posted this in the excel macro section I'll post a macro solution as well

    Please Login or Register  to view this content.
    Alf
    If you do not mind attach the excel VBA file frnd pls

  6. #6
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Re: A validation need --- Excel VBA (Macros)

    Quote Originally Posted by José Augusto View Post
    This formula gives you True if the 4 rules are true and False otherwise
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If you want validate the use of lowercase=uppercase you can use UPPER(A2) instead A2
    Thank you for the reply.But I need this from VBA frnd

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: A validation need --- Excel VBA (Macros)

    Please Login or Register  to view this content.
    I guess you can't apply the code, so attach a workbook showing where(range) to apply.

  8. #8
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Re: A validation need --- Excel VBA (Macros)

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    I guess you can't apply the code, so attach a workbook showing where(range) to apply.
    This is very useful frnd. But The cell clears whole code when the user enters wrong code.How do I validate one by one with different validations ?

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: A validation need --- Excel VBA (Macros)

    Quote Originally Posted by ThiliSuper View Post
    How do I validate one by one with different validations ?
    No idea about what you are trying to say.

    What exactly are you trying to do?

  10. #10
    Registered User
    Join Date
    09-24-2016
    Location
    Colombo
    MS-Off Ver
    Excel 2016 MSO (16.0.4266.1001) 64-bit
    Posts
    21

    Re: A validation need --- Excel VBA (Macros)

    Quote Originally Posted by jindon View Post
    No idea about what you are trying to say.

    What exactly are you trying to do?
    eg : V-B0004

    When user enters first character as alphabetic(except capital V) or numeric value or special character -- Validation message should be "First character should be V"
    When user enters second character as special character(except -) or numeric value or alphabetic -- Validation message should be "second character should be -"
    When user enters third character as special character or numeric value-- Validation message should be "third character should be alphabetic"
    When user enters last four characters as special character or alphabetic -- Validation message should be "last four characters should be numeric values"

+ 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. Using Macros with Data Validation
    By saa2689 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2014, 10:34 AM
  2. Validation Lists and Macros
    By Pony08 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2013, 01:48 PM
  3. VBA Coding Help With Validation Macros in Excel 2010
    By Gavilan101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2013, 02:37 AM
  4. [SOLVED] Excel 2007 Macros based off Data Validation list to populate rows
    By nawilliams62 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2012, 02:53 PM
  5. Self student Project - Validation in Excel with Macros
    By rsarvi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2009, 01:12 AM
  6. [SOLVED] Macros & Validation
    By John Calder in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 06-12-2006, 09:55 PM
  7. [SOLVED] ID Validation using macros in excel
    By Sridhar Machina in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-02-2005, 08:05 AM
  8. Macros and Validation
    By johnspry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2005, 03:03 PM

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