Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a simple input box Marilyn Excel Discussion (Misc queries) 4 October 28th 08 09:08 AM
Simple input/display question Oxylot Excel Discussion (Misc queries) 3 March 10th 08 05:35 AM
how do i auto input dates sgo Excel Discussion (Misc queries) 4 March 29th 07 04:14 AM
Input Mask for Dates Brenda Rueter Excel Discussion (Misc queries) 5 April 24th 06 03:28 PM
Why does Excel change the dates I input? DonnaD Excel Worksheet Functions 2 January 10th 06 09:25 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"