Dim prod As String = "P011112"
Dim mm As Integer = CInt(prod.Substring(1, 2))
Dim yy As Integer = CInt(prod.Substring(3, 2))
MsgBox(MonthName(mm, False) & ", " & yy + 2003) 'output is "January, 2014"
Assumes that the digits in the string are valid for conversion to date.
Reverend Jim
Posting Shark
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159