How to check if Excel sheet name is in correct format

Hi guys, I need to know how can I check if Excel sheet names are in date format YYYYMM.
I have a list of strings that stores all the sheets in the Excel, and I doing an if condition to check if there is any sheet named with the current year and month, e.g “202101”.
Hope anyone can help me out.

@filipe.a.silva -

  1. Use 'Get Workbook sheets" activity to get all the sheets name …


  1. Use For Each activity to loop through the sheets

  2. Inside the foreach …Extract the YYYYMM value from the sheetname using string manipulation methods (split or Substring or Regex) methods

  3. Compare that will extractString=now.tostring(“YYYYMM”) …

Hope this helps…

Question: Can i get a sample of your sheet name?

HI @prasath17 thank you for your response! Here’s a sample of my sheets names.
image So as you can see, I really don’t need to manipulate the string, just need to see if any sheet name matches the current month/year.

And if you could give me an ideia on how to do the same but with date format like “February 2021”/“Nov 2021”?

Thank You for your help!

@filipe.a.silva -

If you want to check for both current year or current month…you can’t do in one shot right…you still have to split the strings…for ex:

202002 - is not current year but current month
202101 - is current year but not current month

So please clarify?

Then again , I see two more formats October(MMMM) and Nov(MMM) ??

@filipe.a.silva - Please find the starter help here. (45.7 KB)

Please expand this workflow for your other use cases.