Thread: Date Format
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
juliejg1 juliejg1 is offline
external usenet poster
 
Posts: 81
Default Date Format

Thanks1

"Edwin Tam" wrote:

You can instead use:
txtDate.Value = Date

However, as long as you want the value to be a "date", there is no way to
get rid of the "day". (Otherwise, it's not a date! A date contains "year",
"month", and "day", three components.) You can at most use cell format to
display only the month and year.

There should be other approaches which can be used in the "formulas" you
mentioned. Maybe you can share with us and I'm sure someone can help.

Regards,
Edwin Tam

http://www.vonixx.com


"juliejg1" wrote:

I have created a user form which automatically enters the current date by
using the following code in the UserForm Initialize.
txtDate.Value = Now()
When the information is put in the spreadsheet it shows the date in one cell
like this:
4/9/2006 19:33
I would like to format the date in vba within the form so that it returns
only the month and year, leaving out the day and time. I don't want to do
this by formatting the column in the worksheet because I will need to
manipulate the date in formulas.