J
James
Hi
I have a Form with a TextBox in which a user is supposed
to enter a date, to be used in a calculation later on.
This is giving me a couple of headaches:
(a) How do I go about providing validation for the
TextBox.Value? Currently I have a line that looks like:
If TextBox.Value >= 1/04/2004 And _
TextBox.Value <= 31/3/2005 Then
This doens't work, since something like 1/04/02 returns
TRUE for the above If statement
(b) When I use the TextBox.Value to update a cell on my
worksheet, the value returned is a text value, ie. can't
use it in the calculation. What am I doing wrong?
Thanks in advance,
James
(new to VBA)
I have a Form with a TextBox in which a user is supposed
to enter a date, to be used in a calculation later on.
This is giving me a couple of headaches:
(a) How do I go about providing validation for the
TextBox.Value? Currently I have a line that looks like:
If TextBox.Value >= 1/04/2004 And _
TextBox.Value <= 31/3/2005 Then
This doens't work, since something like 1/04/02 returns
TRUE for the above If statement
(b) When I use the TextBox.Value to update a cell on my
worksheet, the value returned is a text value, ie. can't
use it in the calculation. What am I doing wrong?
Thanks in advance,
James
(new to VBA)