Hi,

I'm sure I'm being a numpty and missing something here - but I can't get the following formula to calculate in VBA:

=Month(DateValue(A1 & "1"))

I've substituted the A1 reference for a string variable which contains the first three letters of the month, and tried application.worksheetfunction, application and evaluate, but keep geting a 'type mismatch' error which I guess is as a result of trying to convert a string value into a numeric one.


Dim intWSMonth as Integer
Dim strWSMonth as String

'e.g. strWSMonth contains "Feb"

intWSMonth = Application.WorksheetFunction.Month(DateValue(strWSMonth & "1"))
Works fine as a fomula though so sure VBA can handle it, I'm just not speaking the same language it would appear!

Any assistance appreciated.

Thanks, TC