ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula (https://www.excelbanter.com/excel-discussion-misc-queries/205039-formula.html)

Doug

Formula
 
I want to add a date when I enter information into a cell and keep that date
contant. Example: Col. A cell 2 (Date) Col. B Cell 3 (Bus Number) If our
mechanic works on a bus and enter a bus number the date will auto complete.
That date will stay even when a new cell Bus number is enter in on a
different day.

Date: Bus: #
Oct. 3, 2008 41
Oct. 4, 2008
51


joel

Formula
 
Your need a worksheet change function. go to the sheet name tab on the
bottom of the worksheet (like sheet1) and right click. select View Code.
Page the subroutine below on the VBA sheet that appears.


Sub worksheet_change(ByVal target As Range)

If target.Column = 2 Then
target.Offset(0, -1) = Date
End If
End Sub

"Doug" wrote:

I want to add a date when I enter information into a cell and keep that date
contant. Example: Col. A cell 2 (Date) Col. B Cell 3 (Bus Number) If our
mechanic works on a bus and enter a bus number the date will auto complete.
That date will stay even when a new cell Bus number is enter in on a
different day.

Date: Bus: #
Oct. 3, 2008 41
Oct. 4, 2008
51



All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com