Solved

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

Posted on 2013-06-10
3
415 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now