Find and Replace cell

  • Thread starter Thread starter tang
  • Start date Start date
T

tang

I would like to find all cells beginning with a text, eg "!a" and paste the
cells with "Good".
Eg, cells with "!a1", "!a2" and "!a3" will be replaced with "Good"

I can't find any function in Excel can do such work.

Thanks in advance for your advice.
 
Hi
if your cells are in column A try the following:

Sub change_rows()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = 1 to lastrow
with Cells(RowNdx, "A")
if left(.value,2) = "!a" then
.value = "Good"
End If
end with
Next RowNdx
Application.ScreenUpdating = True
End Sub
 
Select your cells, press Ctrl+H, and use:

Find what: !a*
Replace with: Good

HTH
Jason
Atlanta, GA
 
Back
Top