Find and Replace cell

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.
 
F

Frank Kabel

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
 
J

Jason Morin

Select your cells, press Ctrl+H, and use:

Find what: !a*
Replace with: Good

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top