#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Art Art is offline
external usenet poster
 
Posts: 587
Default Insert Date

Hello all:

How can I use a formula to insert a date in a cell the last time something
was used.

I have in chart which I enter codes. For E.G. from A1:A10 I enter codes. And
in B1:B10 I have a list of all kinds of codes. I want the formula to enter a
date in C1:C10 the date the code was used.

So if I enter today in cell A1 the code 239, then in C5 which is next to B5
which contains the code "239" it should insert the date 5/10/09. And evrytime
I use it again it should insert the newer date.

Any help is appreciated.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Insert Date

Set the Security level to low/medium in (Tools|Macro|Security). Right click
on the sheet tab and 'view code' and paste the below code OR launch VBE using
Alt+F11. Double click the sheet tab and paste the code..

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lngRow as Long
If Target.Column = 1 And Target.Row < 11 Then
lngRow = WorksheetFunction.Match(Target.Value, Range("B1:B10"), 0)
If lngRow 0 Then Range("C" & lngRow) = Date
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"art" wrote:

Hello all:

How can I use a formula to insert a date in a cell the last time something
was used.

I have in chart which I enter codes. For E.G. from A1:A10 I enter codes. And
in B1:B10 I have a list of all kinds of codes. I want the formula to enter a
date in C1:C10 the date the code was used.

So if I enter today in cell A1 the code 239, then in C5 which is next to B5
which contains the code "239" it should insert the date 5/10/09. And evrytime
I use it again it should insert the newer date.

Any help is appreciated.

Thanks.

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 newguy Excel Discussion (Misc queries) 3 January 13th 09 04:47 PM
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Insert new date once. Eric Vogel Excel Worksheet Functions 1 July 6th 06 04:17 PM
Automatically Insert DATE, so that DATE will NOT change Cie Excel Worksheet Functions 4 April 4th 05 05:51 PM


All times are GMT +1. The time now is 03:40 PM.

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

About Us

"It's about Microsoft Excel"