aayaanmayank
Board Regular
- Joined
- Jul 20, 2018
- Messages
- 157
Hi All, below code is working on Active cell. however i want this code to run on entire worksheet.
Code:
Sub MyTracer()Dim rngTrace As Range
Set rngTrace = Range("xx" & Rows.Count)
Dim CheckPrecedents As Variant
On Error Resume Next
CheckPrecedents = ActiveCell.Precedents
If Err Then Exit Sub
With ActiveCell
If rngTrace.Value = 1 Then
.ShowPrecedents Remove:=True
rngTrace.Value = 0
Else
.ShowPrecedents
rngTrace.Value = 1
End If
End With
End Sub