Leading Zero for Long
An input box is text. so the best thing to do is to convert the date to
microsfot serial date and then format the date however you want. the user
can input the date in any vaid date format they want. For example
MyDate = inputbox("enter Date : "
SerialDate = DateValue(MyDate)
FormatDate = Format(SerialDate,"MMDDYY")
or for 4 digit year
FormatDate = Format(SerialDate,"MMDDYYYY")
or
FormatDate = Format(SerialDate,"MMMM DD, YYYY")
MM = 2 Digit month
MMM = 3 Character abbreviated Month
MMMM = Full Name of Month spelled out.
" wrote:
Hello:
I am using an inputbox to set a variable to a specific number and need
to preserve the leading zero because it affects an address reference
to a file I am trying to download.
It uses 2 digits for month and day, with a leading zero for single
digit months/days.
The macro prompts the User for the month they want to pull the report
for, then the day.
Your help is most appreciated.
Steven
|