View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Find and replace macro

Consider:

Sub suby()
Dim s As String, t As String, rr As Range
s = Range("A2").Value
t = Range("B2").Value
Set rr = ActiveSheet.UsedRange.SpecialCells(xlCellTypeFormu las)
For Each r In rr
r.Formula = Replace(r.Formula, s, t)
Next
Range("A2").Value = Range("B2").Value
Range("B2").Clear
End Sub
--
Gary''s Student - gsnu200825