M
Maryna
I have to have the date added automatically in column H if the info is added
in column F of the same row. The code I wrote works but I have to return to
column F after the info is added in F and only after that reverse-move does
the required info appear in H
Where is my mistake and how to fix this problem?
Thanks!
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myCell As Range
If Intersect(Target, Range("F:F")) Is Nothing Then Exit Sub
ApplicationEnableEvents = False
Range("H:H").NumberFormat = "mm/dd/yyyy"
For Each myCell In Intersect(Target, Range("F:F"))
rw = myCell.Row
Cells(rw, "H").FormulaR1C1 = "=IF(RC[-2]<>"""", Now(), """")"
Cells(rw, "H").Value = Cells(rw, "H").Value
Cells(rw, "M").Value = Environ("UserName")
Next myCell
Application.EnableEvents = True
End Sub
in column F of the same row. The code I wrote works but I have to return to
column F after the info is added in F and only after that reverse-move does
the required info appear in H
Where is my mistake and how to fix this problem?
Thanks!
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myCell As Range
If Intersect(Target, Range("F:F")) Is Nothing Then Exit Sub
ApplicationEnableEvents = False
Range("H:H").NumberFormat = "mm/dd/yyyy"
For Each myCell In Intersect(Target, Range("F:F"))
rw = myCell.Row
Cells(rw, "H").FormulaR1C1 = "=IF(RC[-2]<>"""", Now(), """")"
Cells(rw, "H").Value = Cells(rw, "H").Value
Cells(rw, "M").Value = Environ("UserName")
Next myCell
Application.EnableEvents = True
End Sub