![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Can you set up a cell on a worksheet that will display a control only when the cell is selected? For example, I'd like to have a cell on my sheet that, when selected, displays the Calendar Control 8.0. The user could select a date on the control and that date would appear in the selected cell. When the date is entered and/or another cell is selected, the control is no longer visible. Any tips on setting this up?
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Try putting a calendar on your sheet and setting it's visible property to False. Put the following code into your worksheet, it will show the calendar control whenever you click in Cell A1 and hide it if any other cell is selected (change to suit your needs): -
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Address = "$A$1" Then Calendar1.Visible = True Else: Calendar1.Visible = False End If End Sub |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks Mudface - that works great!
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|