AwesomeThanks Bob
![]()
To clear things up a little more, I wanted a VBA way to do it...it has nothing to do with the cells. I have a workbook that has the month's names as worksheets (so the months are Strings, Charlize) and keeps records of monthly data. For fun I decided to make (well, start to make) a procedure that adds a worksheet corresponding to the next month using a template.
I just started, but this is what the code is so far (just testing Bob's code):
[vba]Sub NewMonth()
Dim ws As Excel.Worksheet
Dim HighestMonth As Long
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible Then
If Month(DateValue("01-" & ws.Name & "-1900")) > HighestMonth Then
HighestMonth = Month(DateValue("01-" & ws.Name & "-1900"))
End If
End If
Next ws
Debug.Print HighestMonth
End Sub[/vba]