Link to home
Start Free TrialLog in
Avatar of cookre
cookreFlag for United States of America

asked on

Date picker

I've a sheet with a date colimn.  Being a lazy SOB, I've grown tired of entering the a date for every new row I add.

Is there a way to, whenever a cell in that date column gets focus, to pop up a date picker, defaulting to Today, then, when a date has been selected, move right to the next column?

I have no experience with Excel other than embedding simple formulae in cells, but, being a programmer, I can probably follow instructions reasonably well.

Avatar of byundt
byundt
Flag of United States of America image

Hi cookre,
One trick that you may find useful: You can enter today's date in the cell if you hold the Control key down then hit the semicolon key.

Brad
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cookre

ASKER

>>If the above procedure doesn't work, then Brad
No need to exersize that branch - works like a charm.

tnx...
I know this is an old question... but how do you do this by right clicking, like you said byundt?  Thanks!
kylen1010,
To do it by right-clicking, you would use something like the following event macro in the code pane of a worksheet. The posted sub watches cells A1:A10 for right-clicks. It will then display UserForm1. If the user right-clicks any other cell, the usual context-sensitive menu appears.

To install a sub in the code pane for a worksheet:
1) Right-click the sheet tab for the worksheet
2) Choose View Code from the resulting pop-up
3) Paste the suggested code in the resulting module sheet
4) ALT + F11 to return to the worksheet

If the above procedure doesn't work, then you need to change your macro security setting. To do so, open the Tools...Macro...Security menu item. Choose Medium, then click OK.

Brad
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, [A1:A10]) Is Nothing Then Exit Sub
 
Cancel = True
UserForm1.Show
End Sub

Open in new window

Awesome, thank you very much, your code worked perfectly!