Hello. If there are formulas with 2 number "12's", how can I search and replace the second instance?
Hello. If there are formulas with 2 number "12's", how can I search and replace the second instance?
I believe you need a macro for that.
Try selecting the cell(s) containing the formula and run this macro.
![]()
Sub SearchAndReplace() Dim c As Range, s1, s2, n, j, k s1 = "12" ' Text to search s2 = "13" ' Text to replace with n = 2 ' Nth instance to replace For Each c In Selection k = 0 j = 0 Do While InStr(j + 1, c.Formula, s1) j = InStr(j + 1, c.Formula, s1) If j Then k = k + 1 If k = n Then c.Formula = Left(c.Formula, j - 1) & s2 & Mid(c.Formula, j + Len(s1)) Exit Do End If Loop Next End Sub
多么想要告诉你 我好喜欢你
There isn't a way to do it with a formula?
Maybe, but I don't know how.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks