View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Date Format in Userform

as long as you can legislate that they type it correctly (!)

use the exit event of the textbox (for this example called TxtDate)

txtDate.text=Format(DateSerial(Right(TxtDate, 2), Mid(txtDate, 3, 2),
Left(txtDate, 2)), "dd-mmm-yyyy")


(note I'm in the UK so have taken your date as DDMMYY - change the date
serial around as necessary)
Peter1999 wrote:
Hi,

I'm looking for a code to transform a number value in a userform to a
date value after enter is pressed. For example, in the UF, the user
would enter 010100, which would change to the date format 01-Jan-2000
after enter (or tab) is pressed or another cell selected. Any ideas?
Thanks in advance,

Peter


--
Peter1999
------------------------------------------------------------------------
Peter1999's Profile: http://www.excelforum.com/member.php...o&userid=33997
View this thread: http://www.excelforum.com/showthread...hreadid=549886