Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Text box in userform

I have a text box in a user form that has the user put in a date. I want the text box to change the format mm/dd/yyyy in the text box if the user puts the date in like this 41304 when they tab or click to the next textbox it would format the date to this 04/13/04. I am not sure how to do this. Help would be greatly appreciated

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Text box in userform

use the change or afterupdate event of the textbo
and do this:

dim MyDate as Varian
MyDate = Me.Textbox_Nam
if isdate(MyDate) the
Me.Textbox_Name.text = format( MyDate,"mm/dd/yy"
end i

----- Tim wrote: ----

I have a text box in a user form that has the user put in a date. I want the text box to change the format mm/dd/yyyy in the text box if the user puts the date in like this 41304 when they tab or click to the next textbox it would format the date to this 04/13/04. I am not sure how to do this. Help would be greatly appreciated

Thanks
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Text box in userform

or just ues the mask property of ur textbox to control how the user inputs the date
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Text box in userform

Tim,

this needs some rules. Is 11204 11th Feb 2004, or 1st Dec 2004? Once you
have the rules, it will be a simple matter of formatting with MID function
etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tim" wrote in message
...
I have a text box in a user form that has the user put in a date. I want

the text box to change the format mm/dd/yyyy in the text box if the user
puts the date in like this 41304 when they tab or click to the next textbox
it would format the date to this 04/13/04. I am not sure how to do this.
Help would be greatly appreciated.

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm text will not wrap pgarcia Excel Discussion (Misc queries) 1 September 11th 07 11:44 PM
Text box on userform pcrobinson Excel Programming 3 January 8th 04 08:32 AM
Userform and Text Box Jamie[_6_] Excel Programming 5 December 16th 03 04:44 PM
userform text boxes Jo[_4_] Excel Programming 4 September 23rd 03 03:38 AM
Userform text box John Wilson Excel Programming 0 September 10th 03 07:31 PM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"