Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple way to input dates
Just wondering if there is a simple way to have a user
input a date. I have been trying to make a user form where a user will input a valid date. I made dropdown lists to choose month day and year, but I don't want the user to be given the choice to select an invalid date. In otherwords I need to make sure that the number of days in a month is correct. I intend to further narrow down the choice of valid dates to being only weekdays and not holidays, in case this changes your opinion on what the best solution for me would be. Thanks in advance for any advice! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple way to input dates
Hi Wes,
Look for "Text Box to input dates in VBA code" at this site: http://cpap.com.br/orlando For filter weekend days do this: - Look for this line comments on the code: 'Limiting the date. (If you don't want limit, remove the below lines) - Above this line add something like this: If Application.WorksheetFunction.Weekday(DateValue(i) ) = 1 Or Application.WorksheetFunction.Weekday(DateValue(i) ) = 7 Then MsgBox "Invalid Date. Sunday and Saturday are invalid", vbCritical, "CPAP®" Cancel = True End If 'The same way you can filter holidays from here -- HTH --- Orlando Magalhães Filho (So that you get best and rapid solution and all may benefit from the discussion, please reply within the newsgroup, not in email) HTH --- (So that you get best and rapid solution and all may benefit from the discussion, please reply within the newsgroup, not in email) "Wes" escreveu na mensagem ... Just wondering if there is a simple way to have a user input a date. I have been trying to make a user form where a user will input a valid date. I made dropdown lists to choose month day and year, but I don't want the user to be given the choice to select an invalid date. In otherwords I need to make sure that the number of days in a month is correct. I intend to further narrow down the choice of valid dates to being only weekdays and not holidays, in case this changes your opinion on what the best solution for me would be. Thanks in advance for any advice! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create a simple input box | Excel Discussion (Misc queries) | |||
Simple input/display question | Excel Discussion (Misc queries) | |||
how do i auto input dates | Excel Discussion (Misc queries) | |||
Input Mask for Dates | Excel Discussion (Misc queries) | |||
Why does Excel change the dates I input? | Excel Worksheet Functions |