ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forcing a date entry? (https://www.excelbanter.com/excel-programming/302500-forcing-date-entry.html)

Junior[_2_]

Forcing a date entry?
 
Hi my worksheet has cells that are formatted as dates
however, they will accept txt entrys
how can i require the user to enter a date in these cells?



mudraker[_282_]

Forcing a date entry?
 
Junior

try

Data Menu Validation set Validation criteria = date

fill in the rest of the required details to suit your requirement

--
Message posted from http://www.ExcelForum.com


Norman Jones

Forcing a date entry?
 
Hi Junior,

Why not use a pop-up calendar control for the relevant cells?

For Ron de Bruin's code and instructions see:

http://www.rondebruin.nl/calendar.htm


---
Regards,
Norman



"Junior" wrote in message
...
Hi my worksheet has cells that are formatted as dates
however, they will accept txt entrys
how can i require the user to enter a date in these cells?





Tom Ogilvy

Forcing a date entry?
 
Look at Data=Validation and select Date.

--
Regards,
Tom Ogilvy

"Junior" wrote in message
...
Hi my worksheet has cells that are formatted as dates
however, they will accept txt entrys
how can i require the user to enter a date in these cells?





Junior[_2_]

Forcing a date entry?
 
thnaks everyone-
"Junior" wrote in message
...
Hi my worksheet has cells that are formatted as dates
however, they will accept txt entrys
how can i require the user to enter a date in these cells?





Marcotte A

Forcing a date entry?
 
"Norman Jones" wrote:

Hi Junior,

Why not use a pop-up calendar control for the relevant cells?

For Ron de Bruin's code and instructions see:

http://www.rondebruin.nl/calendar.htm


I have a similar problem. I have a text box on a user form where the user enters a date. I'm having trouble verifying that a valid date was entered. Using a Calendar would be great. However, after I downloaded and installed mscal.ocx I'm still having trouble adding a calendar to my user form. I've added the calendar control to the tool box, but when I try to draw it on the userform I get the message "Library not registered." with an OK and Help button. Pressing help opens a help window with absolutely nothing in it. I'm running XL 2003 on Win XP and installed mscal.ocx in c:\windows\system32 using Start....Run..."regsvr32 mscal.ocx " as instructed by the link on Rons page. Am I doing something wrong? Is there an easy way (without using a calendar - since I would have to install this on other computers as well) to make a text box only accept dates? TIA
Marcotte

Norman Jones

Forcing a date entry?
 
Hi Marcotte,

With reference to the calendar control installation issues, see Ron de
Bruin's notes:
http://www.fontstuff.com/vba/vbatut07.htm
See in particular Ron's comments vis-a-vis Office Professional and Access.

To validate your users' textbox date entries, you can use VBA's IsDate
function, e.g. something like:

If IsDate(TextBox1.Text) Then
'Valid Date
'Your code
Else
TextBox1.Text = ""
MsgBox "Invalid date" & vbNewLine _
& "Date must be prior to 1/1/2005 - Please re-enter"
',,,,,,,,,,,,,,,,,,,,,,,
End If


---
Regards,
Norman

"Marcotte A" wrote in message
...
"Norman Jones" wrote:

Hi Junior,

Why not use a pop-up calendar control for the relevant cells?

For Ron de Bruin's code and instructions see:

http://www.rondebruin.nl/calendar.htm


I have a similar problem. I have a text box on a user form where the user

enters a date. I'm having trouble verifying that a valid date was entered.
Using a Calendar would be great. However, after I downloaded and installed
mscal.ocx I'm still having trouble adding a calendar to my user form. I've
added the calendar control to the tool box, but when I try to draw it on the
userform I get the message "Library not registered." with an OK and Help
button. Pressing help opens a help window with absolutely nothing in it.
I'm running XL 2003 on Win XP and installed mscal.ocx in c:\windows\system32
using Start....Run..."regsvr32 mscal.ocx " as instructed by the link on Rons
page. Am I doing something wrong? Is there an easy way (without using a
calendar - since I would have to install this on other computers as well) to
make a text box only accept dates? TIA
Marcotte





All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com