How do I enter dates with one keystroke

B

barefoot

I am new to excel. This may be the stupidest question of all time, bu
I would like to know how to assign, program, or whatever you call it i
excel a date to a key so that when I am in a cell and want to enter tha
date all I have to do is use one keystroke. For example, can I someho
assign a date like 07/26/08 to the F10 key so that every time I pres
F10 the date 07/26/08 is entered into the cell where the cursor is?

Thanks in advance for any help you can provide me
 
C

CTURNER82

This may not be exactly what you're looking for, but to enter the current
date in a cell click Control + ;. If you're entering 7/26/08 in multiple
cells you could copy (the text) and select the cells you want it in by
holding Control and clicking on them, then paste. I hope that is somewhat
helpful. Best wishes!
 
T

tsides

Select a blank cell anywhere on your worksheet.

Go to Tools -> Macro -> Record New Macro. Choose a character to enter
into the box for a Shortcut Key. Click OK.

Type the date you want to enter. Click the check mark next to the
edit area at the top to complete your data entry. Click the stop
button on the macro recorder toolbar that appeared when you started
recording.

Now check your code. Click Alt+F11 to open the code. Double-click
the "Modules" folder. Double-click "Module1" to look at the code.
You should see something like:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/13/2008 by Trevor M. Sides
'
' Keyboard Shortcut: Ctrl+d
'
ActiveCell.FormulaR1C1 = "7/26/2008"
End Sub

Remove any other code, especially things like:
Range("D15").Select

You can repeat this for as many shortcut dates as you want. You must
record the macro for each one, though, copy/pasting that code and
changing the Keyboard Shortcut line doesn't actually create the
shortcut.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top