ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change to a Cell causes action (https://www.excelbanter.com/excel-programming/358223-change-cell-causes-action.html)

Jordan

Change to a Cell causes action
 
Good Morning,

I would like to solve this with a formula if at all possible. I want my
workbook to record, in the adjacent cell, when someone makes a change to a
cell in column A. So in cells B3:B10 the equations a
=IF(A3="","",NOW())
=IF(A4="","",NOW())
and so on. The problem I have is that when I update any of those cells, the
dates for all of them change. Is there a way to setup the workbook so that
if someone updates A5, only the date in B5 changes?

Thanks a bunch,
jordan

Bob Phillips[_6_]

Change to a Cell causes action
 
'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "A3:A10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = "" Then
.Offset(0, 1).Value = ""
Else
.Offset(0, 1).Value = Format(Time, "hh:mm:ss")
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jordan" wrote in message
...
Good Morning,

I would like to solve this with a formula if at all possible. I want my
workbook to record, in the adjacent cell, when someone makes a change to a
cell in column A. So in cells B3:B10 the equations a
=IF(A3="","",NOW())
=IF(A4="","",NOW())
and so on. The problem I have is that when I update any of those cells,

the
dates for all of them change. Is there a way to setup the workbook so

that
if someone updates A5, only the date in B5 changes?

Thanks a bunch,
jordan




Carim

Change to a Cell causes action
 
Hi Jordan,

Take a look at the solution :
http://www.mcgimpsey.com/excel/timestamp.html

HTH
Carim


Tom Ogilvy

Change to a Cell causes action
 
=IF(A3="","",If(B3="",NOW(),B3))
=IF(A4="","",if(B4="",NOW(),B4))

Before you enter these formulas, you need to go to Tools=Options, calculate
tab and check Iterations; set max iterations to 1.

You may have to repeat this setting when you close excel and reopen it.
Setting it allows circular references.


If a cell in column A already has a value and you want to change that value,
you need to clear the cell first, then enter a new value.
--
Regards,
Tom Ogilvy

"Jordan" wrote:

Good Morning,

I would like to solve this with a formula if at all possible. I want my
workbook to record, in the adjacent cell, when someone makes a change to a
cell in column A. So in cells B3:B10 the equations a
=IF(A3="","",NOW())
=IF(A4="","",NOW())
and so on. The problem I have is that when I update any of those cells, the
dates for all of them change. Is there a way to setup the workbook so that
if someone updates A5, only the date in B5 changes?

Thanks a bunch,
jordan



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

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