Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check date
I would like a code that checks that a date enetered is not greater than
todays date. In Cell A1 i have an autosum NOW() that displays todays date. I have some code below that i have tried to manipulate from elswhere but its not working. A userform opens and i want the date in textbox 1 to be checked to ensure it is no greater than todays date. Am i anywhere near and also can code be used to check against an autosum value? Do If IsDate(Me.TextBox1.Value) Then If Val(Me.TextBox1.Value) Range("A1") Then MsgBox "date cannot be greater than today's date" Me.TextBox1.SetFocus Exit Sub End If Else MsgBox ("Bad Value") End If Loop While Not IsDate(Me.TextBox1.Value) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check date
from
If Val(Me.TextBox1.Value) Range("A1") Then to If DateValue(Me.TextBox1.Value) Range("A1") Then "Woodi2" wrote: I would like a code that checks that a date enetered is not greater than todays date. In Cell A1 i have an autosum NOW() that displays todays date. I have some code below that i have tried to manipulate from elswhere but its not working. A userform opens and i want the date in textbox 1 to be checked to ensure it is no greater than todays date. Am i anywhere near and also can code be used to check against an autosum value? Do If IsDate(Me.TextBox1.Value) Then If Val(Me.TextBox1.Value) Range("A1") Then MsgBox "date cannot be greater than today's date" Me.TextBox1.SetFocus Exit Sub End If Else MsgBox ("Bad Value") End If Loop While Not IsDate(Me.TextBox1.Value) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check date
Thanks Joel, you have rescued my code again. Thought i was somewhere near.
"joel" wrote: from If Val(Me.TextBox1.Value) Range("A1") Then to If DateValue(Me.TextBox1.Value) Range("A1") Then "Woodi2" wrote: I would like a code that checks that a date enetered is not greater than todays date. In Cell A1 i have an autosum NOW() that displays todays date. I have some code below that i have tried to manipulate from elswhere but its not working. A userform opens and i want the date in textbox 1 to be checked to ensure it is no greater than todays date. Am i anywhere near and also can code be used to check against an autosum value? Do If IsDate(Me.TextBox1.Value) Then If Val(Me.TextBox1.Value) Range("A1") Then MsgBox "date cannot be greater than today's date" Me.TextBox1.SetFocus Exit Sub End If Else MsgBox ("Bad Value") End If Loop While Not IsDate(Me.TextBox1.Value) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date Check | Excel Programming | |||
Check date and act on it | Excel Programming | |||
Change text to date and check against date in cell | Excel Programming | |||
Check for date | Excel Programming | |||
Check date | Excel Programming |