Getting Month Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've tried a few different ways in this macro to get the 05 to resolve to
"May" (06="June",...) but it still seems to want to remain as "05". What am
I missing here?

Sub LoadData(dt As String) 'dt comes in like 0505

mmyy = Trim(dt)
fulldate = Mid(mmyy, 1, 2) & "/01/20" & Mid(mmyy, 3, 2)
MsgBox (Format(Month(fulldate), mmm))
 
Try something like

Debug.Print Format(DateSerial(1900, 5, 1), "mmmm")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top