Consulting

Results 1 to 4 of 4

Thread: Solved: custom format Required in a cell by code

  1. #1

    Solved: custom format Required in a cell by code

    How can i force the user to enter in cell (a1): then two characters and (-) and 3 zeros and one number? .As follows:
    (FY-0008)

    and wrong message.

  2. #2
    VBAX Expert shrivallabha's Avatar
    Joined
    Jan 2010
    Location
    Mumbai
    Posts
    750
    Location
    1. Choose Data Validation
    2. Select custom option
    3. Paste following formula
    =AND(LEFT(A1,3)="FY-",MID(A1,4,3)="000",ISNUMBER(ABS(RIGHT(A1,1))))
    And you will be able to control it!!!
    Regards,
    --------------------------------------------------------------------------------------------------------
    Shrivallabha
    --------------------------------------------------------------------------------------------------------
    Using Excel 2016 in Home / 2010 in Office
    --------------------------------------------------------------------------------------------------------

  3. #3
    VBAX Regular
    Joined
    Jan 2011
    Posts
    35
    Location
    Perhaps:-
    If Not Left([a1], 6) Like "[A-Za-z][A-Za-z][\-][0][0][0]" Then
        MsgBox "Please Enter first 6 characteres like Data ""Az-000"""
    Else
     MsgBox "Format OK"
    End If

  4. #4
    thank U verey much Shrivallabha Great idea of ​​your solution
    ..


    MickG I am grateful to you

Posting Permissions

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