Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

Drop-down lists

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Stricklen - 11 Mar 2008 15:16 GMT
Is there anyway possible to create a Drop-down list that includes the dates of only the current month? If it's March I would like column A to only have March 1st through the 31st to be possible entries. When it becomes April, then April dates are only ones allowed, and so on. If someone could help that would be great!

David
Martin Fishlock - 11 Mar 2008 15:58 GMT
Hi David

One way is to have a working column. This holds the current month and this
is linked to the data validaton drop down list.

Now how do you fill the list:

use =date(year(now()),month(now()),1..31) but
the problems occur on 29/30/31
and all you do is test the month to see if it is different from day 1 (day 1
is in a2):
a2:a29=DATE(YEAR(NOW()),MONTH(NOW()),1.28
a30=IF(MONTH(DATE(YEAR(NOW()),MONTH(NOW()),29))=MONTH(A2),DATE(YEAR(NOW()),MONTH(NOW()),29),""
a31=IF(MONTH(DATE(YEAR(NOW()),MONTH(NOW()),30))=MONTH(A2),DATE(YEAR(NOW()),MONTH(NOW()),30),""
a32=IF(MONTH(DATE(YEAR(NOW()),MONTH(NOW()),31))=MONTH(A2),DATE(YEAR(NOW()),MONTH(NOW()),31),"")
and then you link data vaidation to this list.
Signature

Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.

> Is there anyway possible to create a Drop-down list that includes the dates of only the current month? If it's March I would like column A to only have March 1st through the 31st to be possible entries. When it becomes April, then April dates are only ones allowed, and so on. If someone could help that would be great!
>
> David
GerryGerry - 11 Mar 2008 16:13 GMT
You need to make a new worksheet called Sheet2 with the following formula in cell a1 (top left) giving the first day in the current month:
   =DATE(YEAR(TODAY()),MONTH(TODAY()),1)
then in the cell below (a2)
   =A1+1
drag A2 all the way down till A32. You should have all the days in the current month plus 1 or 2 from next months

in cell B29 enter the following
   =DAY(A29)
drag B29 down till B32

You now need to create a dynamic range which will change according to the days in the current month to do this create a named range called DATES where the refers to is the following:
   =OFFSET(Sheet2!$A$1,0,0,MATCH(1,Sheet2!$B$29:$B$32,0)+27,1)

in the cell you require the dropdown you format it using data validation set toplist where the list source is DATES

Perhaps someone else on this board can explain better than I but it does work

Good luck

PS if you tell me which version of excel you are using, I'll email you a working version
 Is there anyway possible to create a Drop-down list that includes the dates of only the current month? If it's March I would like column A to only have March 1st through the 31st to be possible entries. When it becomes April, then April dates are only ones allowed, and so on. If someone could help that would be great!

 David
David Stricklen - 11 Mar 2008 16:30 GMT
Im using excel 2003
Sandy Mann - 11 Mar 2008 16:14 GMT
Create a list for your dropdown with the first cell formula being:

=DATE(YEAR(TODAY()),MONTH(TODAY()),1)

In Row 2 enter: =H1+1 and copy down to Row 28

In Row 29 enter:

=IF(MONTH(H28+1)=MONTH(H28),H28+1,"")

and copy down to Row 31

Use that list in your Data validation.

Signature

HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk

 Is there anyway possible to create a Drop-down list that includes the dates of only the current month? If it's March I would like column A to only have March 1st through the 31st to be possible entries. When it becomes April, then April dates are only ones allowed, and so on. If someone could help that would be great!

 David
GerryGerry - 11 Mar 2008 16:28 GMT
This is very similar (and a lot simpler) to my proposed solution but with the drawback that you allow blanks to be entered in months with less than 31 days.
 Create a list for your dropdown with the first cell formula being:

 =DATE(YEAR(TODAY()),MONTH(TODAY()),1)

 In Row 2 enter: =H1+1 and copy down to Row 28

 In Row 29 enter:

 =IF(MONTH(H28+1)=MONTH(H28),H28+1,"")

 and copy down to Row 31

 Use that list in your Data validation.

 --
 HTH

 Sandy
 In Perth, the ancient capital of Scotland
 and the crowning place of kings

 sandymann2@mailinator.com
 Replace @mailinator.com with @tiscali.co.uk

   "David Stricklen" <dstricklen@kumc.edu> wrote in message news:47D64DD0.8C8A.004C.0@kumc.edu...
   Is there anyway possible to create a Drop-down list that includes the dates of only the current month? If it's March I would like column A to only have March 1st through the 31st to be possible entries. When it becomes April, then April dates are only ones allowed, and so on. If someone could help that would be great!

   David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.