premjeetgupta
Member
Hi,
I want to find and replace value if greater than 0 to 0 for certain range. Following code I have found on google search. But issue with the code is it change value as "0" for the text as well which are in the range. Please help.
Sub FindReplace()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
If Rng.Value > 0 Then
Rng.Value = 0
End If
Next
End Sub
I want to find and replace value if greater than 0 to 0 for certain range. Following code I have found on google search. But issue with the code is it change value as "0" for the text as well which are in the range. Please help.
Sub FindReplace()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
If Rng.Value > 0 Then
Rng.Value = 0
End If
Next
End Sub