Input Box for today's date

B

Brent E

Good day,

I am looking for the VBA code that, when run, will place the current date in
B2 using this format:
DD MonthName YYYY

For example: Todays date would read
25 November 2008.

If this format is difficult to achieve, using a standard DD/MM/YYYY format
could work.

Your assistance is appreciated. Thanks.

Cordially,
 
B

Brent E

I'd like to include with this the possibility of using an Input Box to
request the user to enter the date, and then place the date in B2 with the
format mentioned. Any suggestions?

Thanks.
 
M

Mike H

Hi,

Maybe this

Sub GetDate()
response = InputBox("Please enter date", "Date Entry", Format(Date, "dd mmmm
yyyy"))
With Sheets("Sheet1").Range("B2")
.Value = response
.NumberFormat = "dd mmmm yyyy"
End With
End Sub

Mike
 
A

Abe

One way is to input this formula in B2: =TODAY()
Then format B2 as follows: right-click on it, select Format Cells, in Number
tab select Custom, in Type box input "dd mmmm yyyy" (without quotes) and
press Enter. Thereafter B2 would always have today's date in that format. No
need for VBA.
 

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

Top