Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
Stop dates from showing as numbers - when formated as dates | Excel Discussion (Misc queries) | |||
Toggle a range of Julian dates to Gregorian Dates and Back | Excel Programming | |||
Using Listbox to specify data in list to enter in textboxs | Excel Programming | |||
followhyperlink event for textboxs | Excel Programming |