• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Validation

donkey shrek

New Member
Hi I'm new to Excel VBA and just wondering what this piece of code means

Code:
If InStr(posA, cityB) > 0 And Len(cityB) > 0 _
               And InStr(cityB, "(") > 0 And StrComp(Right(cityB, 1), ")", vbTextCompare)
Thank you
 
Last edited by a moderator:
donkey shrek
Have You tried to check those syntaxes?
... or what do those functions do?
Here one sample list:
  • The IF function is one of the most popular functions in Excel, and it allows you to make logical comparisons between a value and what you expect.
  • InStr function finds the position of a specified substring within the string and returns the first position of its occurrence.For example, if you want to find the position of ‘x’ in ‘Excel’, using the Excel VBA InStr function would return 2.
  • Use the AND function, one of the logical functions, to determine if all conditions in a test are TRUE.
  • The Excel LEN function returns the length of a given text string as the number of characters. LEN will also count characters in numbers, but number formatting is not included.
  • The Microsoft Excel STRCOMP function returns an integer value representing the result of a string comparison.
 
Back
Top