close

We have a table with material prices, and would like to see at a glance, in
the next cell, when a price was last modified.

manx

Right-click on the sheet tab and quot;View Codequot;.

Copy/paste the following event code to that module.

As you enter/edit prices in column A, the data/time will be stamped in column B.Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range(quot;Aquot; amp; n).Value lt;gt; quot;quot; Then
Excel.Range(quot;Bquot; amp; n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End SubGord Dibben MS Excel MVP

On Fri, 17 Mar 2006 15:57:12 -0800, manxman gt;
wrote:

gt;We have a table with material prices, and would like to see at a glance, in
gt;the next cell, when a price was last modified.Typo.......should be date/time will be stampedGord

On Sat, 18 Mar 2006 15:43:57 -0800, Gord Dibben lt;gorddibbATshawDOTcagt; wrote:

gt;manx
gt;
gt;Right-click on the sheet tab and quot;View Codequot;.
gt;
gt;Copy/paste the following event code to that module.
gt;
gt;As you enter/edit prices in column A, the data/time will be stamped in column B.
gt;
gt;
gt;Private Sub Worksheet_Change(ByVal Target As Excel.Range)
gt;'when entering data in a cell in Col A
gt;On Error GoTo enditall
gt;Application.EnableEvents = False
gt;If Target.Cells.Column = 1 Then
gt; n = Target.Row
gt; If Excel.Range(quot;Aquot; amp; n).Value lt;gt; quot;quot; Then
gt; Excel.Range(quot;Bquot; amp; n).Value = Now
gt; End If
gt; End If
gt;enditall:
gt;Application.EnableEvents = True
gt;End Sub
gt;
gt;
gt;Gord Dibben MS Excel MVP
gt;
gt;On Fri, 17 Mar 2006 15:57:12 -0800, manxman gt;
gt;wrote:
gt;
gt;gt;We have a table with material prices, and would like to see at a glance, in
gt;gt;the next cell, when a price was last modified.

Gord Dibben MS Excel MVP

Thank you Gord, it works great.

quot;manxmanquot; wrote:

gt; We have a table with material prices, and would like to see at a glance, in
gt; the next cell, when a price was last modified.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()