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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar to pop up when cursor moves to a cell - URGENT! 2

Status
Not open for further replies.

Rmcta

Technical User
Nov 1, 2002
478
US
I have got as far as creating a calendar in Excel.
(With the help of
Can anybody tell me how to make the calendar appear when the cursor gets on specific cell and disappear as soon as the cursor moves from out of the cell?

I don't want my users to type dates directly into the cell therefore if I make the calendar pop up above the cell they will be forced to pick a date from the calendar.

Thank you in advance for your help!
 
Here's something to build on:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$B$2" Then
MsgBox "pop up"
End If
End Sub

put it in the code for the sheet (not a separate module)
 
Sorry Zathras, no-one had replied when I started looking into this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strAddress
strAddress = ActiveCell.Address
If Left(strAddress, 3) = "$E$" Then 'enter your own column
Application.Run PERSONAL.XLS!OpenCalendar
End If
End Sub

This assumes that the date will go into a constant column, in this case E, replace E with your column. It also assumes that you followed the instructions at by putting your macro in PERSONAL.XLS. Change this if different.

If your column goes beyond Z replace
If Left(strAddress, 3) = "$E$" Then
with
Left(strAddress, 4) = "$AA$" Then
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top