Another Find and Replace need

S

Steve K

I've searched forum...and have not been able to find a solution. I believe
its quite simple...but beyond my capability.

I would like to search thru column B for all cell values that equals "modify".

If Found, I would like to remove the trailing "i" or "c" in Column C in same
row.
(i.e. change 51005674i to 51005674)
(or change 50004421c to 50004421)

I'd like it to search all rows in worksheet.

I appreciate any help.

Steve
 
J

Jacob Skaria

Hi Steve

Try the below which works on the active sheet

Sub Macro()
Dim varFound As Variant, strAddress As String
With ActiveSheet.Range("B:B")
Set varFound = .Find("modify", LookIn:=xlValues, Lookat:=xlWhole)
If Not varFound Is Nothing Then
strAddress = varFound.Address
Do
varFound.Offset(, 1) = Val(varFound.Offset(, 1).Text)
Set varFound = .FindNext(varFound)
Loop While Not varFound Is Nothing And _
varFound.Address <> strAddress
End If
End With
End Sub

If this post helps click Yes
 
S

Steve K

Jacob - Your the best ! It work perfectly ! Thanks much for your time and
help!!!

Steve
 

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