Hi all,
Thanks for your reply. Sorry it's my first time posting. Will take note of that.
I'm hitting error type mismatch for both codes below. Month and Year is a String. I'm using Excell 2011 on Mac. Is that the problem?
I tried
EndDate = WorksheetFunction.EoMonth(DateSerial(CInt(Year), CInt(Month), 1), 0)
and also
Sub MG04Sep49
Dim MyMonth As String
Dim Year As String
Dim EndDate As Date
Dim Mth As Integer
MyMonth = Range("B1").Value 'July '
Year = Range("D1").Value '2014
Mth = Month("01-" & MyMonth & "-" & Year)
EndDate = DateAdd("d", -1, DateSerial(Year, Mth, "1"))
End Sub
Bookmarks