Question: I have various formats of dates, in strings, all in ColumnA. Here is a small example.

```
-rw-r--r--   35 30067    10224     <-- 2018-09
-rw-r--r--   36 30067    10224     <-- 2018-09
-rw-r--r--   65 30067    10224     <-- 2018-10-24

```

Is there a way I can interpret any date from any given string?

Answer: 
I tried to get date with regular expression. As far as I see, the date is either in the end of the string or there's a dot after it (followed by extension). The regex takes into account the length of the year: either 4 or 2. Also it manages the case when month is expressed in text. *Important!* When the day is absent, I set it as first day.

```
Function GetDate(strString$)
    Dim sYear$, sMonth$, sDay$
    With CreateObject("VBScript.RegExp")
        .IgnoreCase = True: .Pattern = "(\d{2})([a-z]{3}|\d{2})(\d{2})?(?=\.|$)"
        With .Execute(strString)
            If .Count > 0 Then
                With .Item(0)
                    sYear = .SubMatches(0)
                    sMonth = .SubMatches(1)
                    sDay = .SubMatches(2)
                    sYear = "20" & sYear
                    If Not IsNumeric(sMonth) Then
                        sMonth = GetMonthIndex(sMonth)
                    End If
                    If Len(sDay) = 0 Then sDay = "01"
                    GetDate = DateSerial(CInt(sYear), CInt(sMonth), CInt(sDay))
                End With
            End If
        End With
    End With
End Function

Private Function GetMonthIndex$(strMonth$)
    Select Case strMonth
        Case "Jan": GetMonthIndex = "01"
        Case "Feb": GetMonthIndex = "02"
        Case "Mar": GetMonthIndex = "03"
        Case "Apr": GetMonthIndex = "04"
        Case "May": GetMonthIndex = "05"
        Case "Jun": GetMonthIndex = "06"
        Case "Jul": GetMonthIndex = "07"
        Case "Aug": GetMonthIndex = "08"
        Case "Sep": GetMonthIndex = "09"
        Case "Nov": GetMonthIndex = "10"
        Case "Oct": GetMonthIndex = "11"
        Case "Dec": GetMonthIndex = "12"
    End Select
End Function

```
Without any fixed pattern it will be complicated.
The better way in your case on a logical way would by to associate date pattern to files like 

* 1 => \*.BUS -> YYMM
* 2 => \*.IDE -> YYMMDD
* 3 => TTN\* -> YYYYMMDD

And on the same logic get a mapping table with position of date string in the file name

* 1 => Last 4 characters of file name
* 2 => Last 6 characters of file name
* 3 => Extension

In a macro function or a SWITCH function.