Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop-Down Calendar in Worksheet Cell

Status
Not open for further replies.

MeGustaXL

Technical User
Aug 6, 2003
1,055
GB
I'm sure I've seen a thread very recently which described how to have a Data Validation List created by the WorksheetOpen()event, so that you can have a DropDown 'Calendar' to pick from. Despite searching all over the web, I'm unable to find it again!

Tek-Tips moderators/experts - was it on here? If so, where??

Yours hopefully,
Chris
 
Check out this FAQ: faq68-3216

It will lead you to a link that shows you something like what you're looking for!

Good Luck!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Thanks for your V.Quick replies Guys!

Bowers; That's nice to look at, but the bloke who'll be using my application doesn't have mscal.ocx on his machine, and his IT police won't let him download or install it!

Skip; I can only find the Calendar 8.0 and MS Date&Time Picker controls [sad]

Both; The technique I'm thinking of definitely used Data Validation based on a list generated at WorkbookOpen(). This is necessary 'cos I could be using a whole column, and having a calendar Pop-Up in each would make the filesize humungous!

Thanks for your efforts, though [thumbsup2] I guess it's back to Google & Dogpile again [sad]

Chris
 
You use ONE calendar object!

You control the Visible property with the Worksheet_Select event -- when the user selects within the range that you determine, you set the Visible property of the calendar to True -- otherwise False

You also set the Top and Left properties based on the selected cell's top and left properties.

VOLA! :)

Skip,
Skip@TheOfficeExperts.com
 
Sorry Skip - my DUH!; you are spot-on of course.

Still, what if my User hasn't got either of the above controls on his PC? Is the Date&Time Picker carried along with the parent workbook when you change machines?

Chris.
 
Code:
Private Sub Calendar1_Click()
    With Calendar1
        .TopLeftCell.Value = .Value
        .Visible = False
    End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("DateRange")) Is Nothing Then
        With Calendar1
            .Visible = True
            .Top = Target.Top
            .Left = Target.Left
        End With
    End If
End Sub
[/code


Skip,
Skip@TheOfficeExperts.com
[URL unfurl="true"]www.TheOfficeExperts.com[/URL]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top