Nov 22 2017
03:49 AM
- last edited on
Jul 25 2018
09:44 AM
by
TechCommunityAP
Nov 22 2017
03:49 AM
- last edited on
Jul 25 2018
09:44 AM
by
TechCommunityAP
Hi Guys,
I am having trouble trying to record time stamp of active cells which has IF function. For example if I manually change a cell, then this gets recorded in the logsheet with time stamp and value.
But active cells with IF function, for example they give real time buy and sell signals. So when it says buy or sell I want to time stamp this and record this in the logsheet.
I have pasted the following code, but this does not record the values that are generated by active cells, that is buy and sell signals.
I need some help please!
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strAddress As String
Dim val
Dim dtmTime As Date
Dim Rw As Long
If Intersect(Target, Range("A2:Q22")) Is Nothing Then Exit Sub
'change range to suit
dtmTime = Now()
val = Target.Value
strAddress = Target.address
Dim addressRow, addressCol As String
addressRow = Target.row
addressCol = Target.Column
Rw = Sheets("LOG SHEET").Range("A" & Rows.Count).End(xlUp).row + 1
With Sheets("LOG SHEET")
.Cells(Rw, 1) = strAddress
.Cells(Rw, 2) = val
.Cells(Rw, 3) = dtmTime
.Cells(Rw, 4) = GetInstrument(strAddress)
.Cells(Rw, 5) = GetIndicator(strAddress)
End With
End Sub