Hi Rick,
See code section below. I know its not the best. Still quite new to this!
Thanks,
If FromFullDate.Value <> "" Then
Sheets("Template").Select
Range("A9").Activate
j = 9
While CDate(ActiveCell.Value) <> CDate(FromFullDate.Value)
ActiveCell.Offset(1, 0).Activate
j = j + 1
Wend
If ActiveCell.Interior.ColorIndex = 1 Then
Application.ScreenUpdating = True
MsgBox Prompt:="" & CDate(FromFullDate.Value) & " is a weekend or a bank
holiday. Please select a weekday.", _
Buttons:=vbOKOnly + vbExclamation
FromFullDate = ""
Exit Sub
End If
End If
"Rick Rothstein (MVP - VB)" wrote:
> It would help if you could show us your code.
>
> Rick
>
>
> "JohnP" <(E-Mail Removed)> wrote in message
> news:B53BBCF3-3AC9-4034-973E-(E-Mail Removed)...
> > Hi,
> >
> > I have some code for user forms that require date entry. Some of the date
> > fields can be left blank but when the code runs it errors out because my
> > code
> > refers to a blank variable as a cdate. I have phrased this statement
> > within
> > an if so that it should only run if the date field is not blank but it
> > still
> > comes up as a type mismatch error.
> >
> > Any ideas? Let me know if you need more explanation.
> >
> > Thanks in advance for any help you can offer.
> >
> > JohnP
>
>
|