#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Larry
 
Posts: n/a
Default insert date

Hi folks,
I'd like to inset a date automatically when ever a cell within a single
column is selected.
Can I do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default insert date

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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Larry
 
Posts: n/a
Default insert date

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?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default insert date

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?

  #5   Report Post  
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?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Larry
 
Posts: n/a
Default insert date

Thanks again, I'll try thei right away. I take it I should replace 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?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default insert date

Actually, to change from column A to column C, you would change the line
from:
If ActiveCell.Column = 1
To:
If ActiveCell.Column = 3

The two "columnA" in the notations can be changed also, but are only
comments and do not affect the operation

Vaya con Dios
Chuck, CABGx3



"Larry" wrote:

Thanks again, I'll try thei right away. I take it I should replace 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?

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers
 
Posts: n/a
Default insert date

Larry,
A worksheet event would handle this.

Take a look at

http://www.cpearson.com/excel/events.htm

Come back if you need more help.

"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?

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Larry
 
Posts: n/a
Default insert date

Hey, I appreciate the help. I have been using the ctrl key, I have folks that
don't seem to be able to remember this feature. The cells with existing past
dates should remain unchanged, only the newest empty cell will be selected,
if it auto populated the date it would make some others happy. Thanks for the
feedback!

"Toppers" wrote:

Larry,
A worksheet event would handle this.

Take a look at

http://www.cpearson.com/excel/events.htm

Come back if you need more help.

"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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
Want day of the week when I insert a date HT New Users to Excel 5 October 13th 05 03:49 PM
How do I insert an Auto Date in Excel R. Chambers Excel Discussion (Misc queries) 3 October 12th 05 11:36 PM
How do I insert the date the file was saved in the MS Excel foote. kacate Excel Discussion (Misc queries) 2 January 31st 05 09:11 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"