Thread: insert date
View Single Post
  #7   Report Post  
Old June 26th 06, 01:36 PM posted to microsoft.public.excel.worksheet.functions
Larry
 
Posts: n/a
Default insert date

Thanks again for the great help, I'll try this right away; I take it I
replace the A with C to change target column? Take care, larry

"CLR" wrote:

This Change-event macro should do the job automatically......if the user
selects a cell in column that has a value therein, no affect.....if the cell
is blank, the macro will insert todays date.


Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Automatically inserts today's date in cell in column A when selected
'if the cell was empty. Does not overwrite occupied cell.
If ActiveCell.Column = 1 Then 'Limits macro action to column A
If ActiveCell.Value = "" Then 'Check to see if Target cell empty
Selection.Value = Date 'Insert today's date in Target cell
Else
End If
Else
End If
End Sub

"Larry" wrote:

Thanks CLR,
ans: yes and old dates remain.
Some of the folks usimng it can't seem to remember the ctrl ; keys. Thanks
for the help


"CLR" wrote:

A couple of questions.....
1-Are you wanting today's date inserted in an empty cell whenever it's
selected in a certain column?
2-What would you like to have happen to cells in that column being selected
that already contain a date, or some other value?

You can do nearly as good by just holding down the Ctrl key and pressing the
semicolon key.........this will insert today's date in the selected cell.

hth
Vaya con Dios,
Chuck, CABGx3

"Larry" wrote:

Hi folks,
I'd like to inset a date automatically when ever a cell within a single
column is selected.
Can I do this?