?
Solved

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

Posted on 2013-06-10
3
Medium Priority
?
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

743 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