PC Review


Reply
Thread Tools Rate Thread

Another Find and Replace need

 
 
Steve K
Guest
Posts: n/a
 
      10th Nov 2009
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




 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      10th Nov 2009
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
---------------
Jacob Skaria


"Steve K" wrote:

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

 
Reply With Quote
 
Steve K
Guest
Posts: n/a
 
      10th Nov 2009
Jacob - Your the best ! It work perfectly ! Thanks much for your time and
help!!!

Steve

"Jacob Skaria" wrote:

> 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
> ---------------
> Jacob Skaria
>
>
> "Steve K" wrote:
>
> > 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
> >
> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find+Replace Dialog Box, Replace with Format problem Kathy Microsoft Word Document Management 3 1st Feb 2008 04:26 AM
Find/Replace Event or Find/Replace for Protected Sheet ... Joe HM Microsoft Excel Programming 2 27th Oct 2007 03:55 PM
find and replace - replace data in rows to separated by commas =?Utf-8?B?bXNka2Vy?= Microsoft Excel Worksheet Functions 1 15th Apr 2006 01:00 AM
Using find and replace or macros to replace page ranges =?Utf-8?B?SmVyZW15Qw==?= Microsoft Word Document Management 7 13th Feb 2006 09:20 PM
Find/ Replace is auto-capping the words I want to replace with Graham Mayor Microsoft Word Document Management 8 27th Jan 2006 01:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 AM.