Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textboxs as dates


HI mangesh_yadav

After extensive testing I seem to have a problem with validation to
ensure the dates are correct as it should be

Textbox1<textbox2<textbox3

however if the users puts the 31/05/05 and then in textbox2 puts in
01/06/05 is says that the dates are not in order as I think it is
picking up the 31 and the 01 and is not likeing it any ideas?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=368692

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Textboxs as dates


Hi funkymonk,

Assuming you are using this code:

dt1 = DateValue(Mid(TextBox1, 4, 2) & "/" & Left(TextBox1, 2) & "/" &
Right(TextBox1, 4))
dt2 = DateValue(Mid(TextBox2, 4, 2) & "/" & Left(TextBox2, 2) & "/" &
Right(TextBox2, 4))


Textbox1<textbox2<textbox3

however if the users puts the 31/05/05 and then in textbox2 puts in
01/06/05 is says that the dates are not in order as I think it is
picking up the 31 and the 01 and is not likeing it any ideas?



I tried the folloing code:

Sub test()

textbox1 = "31/05/05"
textbox2 = "01/06/05"

dt1 = DateValue(Mid(textbox1, 4, 2) & "/" & Left(textbox1, 2) & "/" &
Right(textbox1, 2))
dt2 = DateValue(Mid(textbox2, 4, 2) & "/" & Left(textbox2, 2) & "/" &
Right(textbox2, 2))

If dt1 dt2 Then MsgBox "not in order"

End Sub


And it does not give error. Which means it is working. Please check if
this is how it should work and let me know.

Another point: The code I gave you earlier, has 2 conditions, I hope
the other one is not falling apart.


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=368692

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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
Toggle a range of Julian dates to Gregorian Dates and Back PSKelligan Excel Programming 4 May 8th 07 05:51 AM
Using Listbox to specify data in list to enter in textboxs dht Excel Programming 0 June 24th 04 02:42 PM
followhyperlink event for textboxs Ignatius Excel Programming 0 August 11th 03 11:25 PM


All times are GMT +1. The time now is 10:33 AM.

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"