Private Sub Worksheet_Change(ByVal Target As Range)
' Record what cell
' Record new value
' record the day
' Record the time
' record the username
' Record the worksheet
On Error GoTo NoLog
Set WSN = Worksheets("Tracking")
On Error GoTo 0
NextRow = Worksheets("Tracking").Cells(Rows.Count, 1).End(xlUp).Row + 1
If Not NextRow = Rows.Count Then
With Worksheets("Tracking")
.Cells(NextRow, 1).Value = Application.UserName
.Cells(NextRow, 2).Value = Date
.Cells(NextRow, 3).Value = Time
'.Cells(NextRow, 4).Value = Target.Parent.Name
.Cells(NextRow, 4).Value = Target.Address
.Cells(NextRow, 5).Value = Target.Value
End With
End If
NoLog:
' there is not a SoxLog worksheet present, exit
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim cell As Range
Dim r As Long
' Check to see what cells just updated in column A
Set rng = Intersect(Target, Range("A:A"))
' Exit if no update made in column A
If rng Is Nothing Then Exit Sub
' Made formatting updates to cells
For Each cell In rng
r = cell.Row
' See if value entered is "B"
If cell = "B" Then
' Apply formatting from columns A:AL
With Range("A" & r & ":AL" & r)
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThick
End With
Else
' If not "B", then remove formatting
With Range("A" & r & ":AL" & r)
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
End With
End If
Next cell
End Sub