I would like to find and replace numbers or text in formulas. I have a macro assigned to a symbol which, when I press it, presents a pop-up screen.
For example in the worksheet "Datasheet1" there are a lot of formulas that have the cell K200 in them. I would like to change them to K300 by using the pop-up screen.
I've come across the formula below, but it doesn't work unfortunately.
Sub Findandreplace()
Set sht = Sheets("Datasheet1")
Dim xFind As String
Dim xRep As String
Dim xRg As Range
On Error Resume Next
Set xRg = Cells
xFind = Application.InputBox("Find:", "Kutools for Excel", , , , , 2)
xRep = Application.InputBox("Replace:", "Kutools for Excel", , , , , 2)
If xFind = "False" Or xRep = "False" Then Exit Sub
xRg.Replace xFind, xRep, xlPart, xlByRows, False, False, False, False
End Sub
Presenting a worksheet is kind of difficult because of the specifics.
Bookmarks