View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Minitman[_4_] Minitman[_4_] is offline
external usenet poster
 
Posts: 273
Default Date Formatting Woes

Hey Jake,

The date is imputed from two sources. The first is on the spreadsheet
as a starting point. The second is on a UserForm.

I formatted the cell with a custom format (mmm dd, yyyy ddd) so that
I could see what day of the week I was working on. The old format was
(mmm dd,yyyy) and the code worked with it.

The UserForm is designed to cycle after each Save event (you hit Save
and the entries are saved and the UserForm is unloaded then reloaded).
The first thing that pops up are three buttons (everything else is
hidden), you choose one and the buttons hide and the date TextBox pops
up. You either change the date or hit enter to continue. This date
gets it's default value from the date on the sheet each time I hit the
Save button. When you exit this date, it then changes the value on
the spreadsheet cell to what ever is in the TextBox.

This is working fine, even with my custom format.

The problem occurs when I try to use the TextBox date to determine if
a variable should equal one constant or another, there being a cutoff
date involved (9/15/97 or in MS, 35690).

What I am looking for is a way to convert/varse or somehow make the
TextBox entry readable as a date.

How can I do this?

TIA

-Minitman






On Wed, 15 Dec 2004 16:50:18 -0700, "Jake Marx"
wrote:

Minitman,

What is putting the text in the textbox? Code, a default value, or the
user? The problem here is that VBA does not recognize a date in that
format:

?IsDate("Dec 15, 2004 Wed")
False

So you'll either have to parse out the date or use a different date format
that is recognizable by VBA.