Saltar al contenido principal

Búsqueda

Búsqueda

If Statement With Wildcard Not Working

Comentarios

2 comentarios

  • Avatar
    Shotaro Ito

    VB Script doesn't have wildcard in IF statement, unlike VBA.

    for "begins with" condition, just take 2 characters like

    If Left(Format.NamedSubStrings("Serial").Value,2) = "GB" Then...
    

    Besides you can use Regular Expression object for wildcard and more flexible matching - see below.

    http://stackoverflow.com/questions/16682155/vbs-compare-strings-using-wildcard

    0
  • Avatar
    Legacy Poster

    VB Script doesn't have wildcard in IF statement, unlike VBA.

    for "begins with" condition, just take 2 characters like

    If Left(Format.NamedSubStrings("Serial").Value,2) = "GB" Then...
    

    Besides you can use Regular Expression object for wildcard and more flexible matching - see below.

    http://stackoverflow.com/questions/16682155/vbs-compare-strings-using-wildcard

     

    Thank you, works perfectly using begins with.

    0

Iniciar sesión para dejar un comentario.