I'm creating a macro which will recognize months and put first 3 letters and 2 last numbers of the year into sheet name. This is what I have created so far:
For example Cells(9,1) is first day of the month (01/01/2016)
Dim mName(13) As Integer
Dim ValDate As String
Dim years As String
Dim mcount As String
mName(1) = January
mName(2) = Febuary
...
mName(13) = December
years = Right(Year(Cells(9, 1)), 2) '16
ValDate = mName(Month(Cells(9, 1))) 'macro says its 0, but it should be January)
mcount = Left(ValDate, 3)
Sheets(Sheets.Count).Name = ValDate & " " & years
Result of the macro is "0 16" My goal is "Jan 16".
Macro works fine (no errors) but its always shows "0" when there is mName integer in ValDate string. Month function works fine with no mName.