Hello,
Help me. I wrote this code for hiding formula from Formula Bar. But formula is not hiding. What is wrong? Could anybody help me??
Dim myDic As New Dictionary
Private Sub Worksheet_HideFormula(ByVal Target As Range)
' Before using this code do must: Tools - References - click on
' "Microsoft Scripting Runtime".
Dim myCell As Range
Dim myRng As Range
Set myRng = Range("A2:J25")
If myDic.Count <> myRng.Count Then
For Each myCell In myRng
myDic.Add myCell.Address, myCell.FormulaR1C1
Next
End If
If (Target.Count = 1) And (Not Application.Intersect(myRng, Target) Is Nothing) And (Target.HasFormula) Then
With Target
.Value = .Value
End With
End If
'MsgBox myDic.Count
myDic.RemoveAll
End Sub
Bookmarks