Solved

how can i get with vba the curret month with two digits

Posted on 2013-06-10
3
421 Views
Last Modified: 2013-06-10
hi


i'm trying this code

 MsgBox Format(Month(Now), "MM")

i want to get the month in two digits like this "06" but for some reason i get a msgbox with "01", why i don't get the right month?
0
Comment
Question by:bill201
3 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 total points
ID: 39234491
MsgBox Format(Now(), "MM")
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39234501
You only need
 MsgBox Format(Now, "MM")
0
 

Author Closing Comment

by:bill201
ID: 39234503
thanks a lot
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create a EXCEL FIle from Access Procedure 1 16
Install both Office 2010 and 2013 4 37
How to use DLookup with IsNull Function 4 26
Sub or Function is not defined 6 29
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question