View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
AltaEgo AltaEgo is offline
external usenet poster
 
Posts: 245
Default convert text month to numeric month

Forgot to add tMth is your text month.

--
Steve

"AltaEgo" <Somewhere@NotHere wrote in message
...
Debug.Print Month(CVDate(tMth & "-1-2000"))

--
Steve

"salgud" wrote in message
...
On Tue, 24 Mar 2009 22:03:30 GMT, Lars-Åke Aspelin wrote:

On Tue, 24 Mar 2009 15:44:22 -0600, salgud
wrote:

I just asked here how to do the opposite. How do I convert "May" to 5
without using a case statement? I've looked all over on the net, but
can't
find this specific thing.

Thanks in advance.

Try this worksheet formula:

=SUMPRODUCT(ROW(1:12)*(TEXT(DATE(,ROW(1:12),1),"MM M")="May"))

Hope this helps / Lars-Åke


Sorry, should have been clear I want to do this in VBA, not in the
spreadsheet.