jeudi 5 novembre 2015

What Kind of Syntax is Necessary when Searching for Specific Text

I am trying to write an If-Statement that searches an assigned date. If that date is the 1st day of the month (say 09/01/2015), the code will skip down to another section. The months and years in the spreadsheet can vary, so I want to only search for the part of the date that indicates the 1st (ie. "/01/"). I'm just not sure what the syntax is for specifying that search criteria.

I've found some information online with people using the functions Contains and Instr, but wasn't sure whether there was a better way to do it. The code would be something along the lines of the following:

-If Date Contains "/01/" Then GoTo LaterPartOfCode

-Else continue with calculations

Aucun commentaire:

Enregistrer un commentaire