Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using Find & Replace in macro

Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Using Find & Replace in macro

Bob,

Replace PARK with a placeholder, do your replacement, and restore the
PARKs. This will work as long as XXXX doesn't appear anywhere in your
data set.

With Columns("B:B")
..Replace What:="PARK", Replacement:="XXXX", LookAt:=xlPart
..Replace What:="PAR", Replacement:="PARK", LookAt:=xlPart
..Replace What:="XXXX", Replacement:="PARK", LookAt:=xlPart
End With

HTH,
Bernie
MS Excel MVP

"Bob C" wrote in message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Find & Replace in macro

I doubt that you can. Replace doesn't offer that level of sophistication to
the best of my knowledge.

You would have to write a macro with a specific algorithm to identify this
situation and make the change.

--
Regards,
Tom Ogilvy

"Bob C" wrote in message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using Find & Replace in macro

Hi Tom
I have just noticed in changing my question around, I
have deleted the part about doing this via macro.
Sorry and thankyou

Bob C

-----Original Message-----
I doubt that you can. Replace doesn't offer that level

of sophistication to
the best of my knowledge.

You would have to write a macro with a specific

algorithm to identify this
situation and make the change.

--
Regards,
Tom Ogilvy

"Bob C" wrote in

message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers

as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Using Find & Replace in macro

Bob,

In case my post has been overlooked or lost:

Bob,

Replace PARK with a placeholder, do your replacement, and restore the
PARKs. This will work as long as XXXX doesn't appear anywhere in your
data set.

With Columns("B:B")
..Replace What:="PARK", Replacement:="XXXX", LookAt:=xlPart
..Replace What:="PAR", Replacement:="PARK", LookAt:=xlPart
..Replace What:="XXXX", Replacement:="PARK", LookAt:=xlPart
End With

HTH,
Bernie
MS Excel MVP


"Bob C" wrote in message
...
Hi Tom
I have just noticed in changing my question around, I
have deleted the part about doing this via macro.
Sorry and thankyou

Bob C

-----Original Message-----
I doubt that you can. Replace doesn't offer that level

of sophistication to
the best of my knowledge.

You would have to write a macro with a specific

algorithm to identify this
situation and make the change.

--
Regards,
Tom Ogilvy

"Bob C" wrote in

message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers

as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using Find & Replace in macro

Hi Bernie
So that's what happens after you read "can not find ISP"
I did post a thankyou and stated your code worked just
fine, but it got lost in transit.

Thankyou
Bob C

-----Original Message-----
Bob,

In case my post has been overlooked or lost:

Bob,

Replace PARK with a placeholder, do your replacement,

and restore the
PARKs. This will work as long as XXXX doesn't appear

anywhere in your
data set.

With Columns("B:B")
..Replace What:="PARK", Replacement:="XXXX",

LookAt:=xlPart
..Replace What:="PAR", Replacement:="PARK",

LookAt:=xlPart
..Replace What:="XXXX", Replacement:="PARK",

LookAt:=xlPart
End With

HTH,
Bernie
MS Excel MVP


"Bob C" wrote in

message
...
Hi Tom
I have just noticed in changing my question around, I
have deleted the part about doing this via macro.
Sorry and thankyou

Bob C

-----Original Message-----
I doubt that you can. Replace doesn't offer that

level
of sophistication to
the best of my knowledge.

You would have to write a macro with a specific

algorithm to identify this
situation and make the change.

--
Regards,
Tom Ogilvy

"Bob C" wrote in

message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the

retailers
as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on

the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Find & Replace in macro

I guess that wouldn't work for

EARNIE'S PARTS AND SERVICES

But if PARK and PARKK are the only conflicts, then it should work fine. I
find making such assumptions usually are not the case - thus my answer.

--
Regards,
Tom Ogilvy

"Bob C" wrote in message
...
Hi Bernie
So that's what happens after you read "can not find ISP"
I did post a thankyou and stated your code worked just
fine, but it got lost in transit.

Thankyou
Bob C

-----Original Message-----
Bob,

In case my post has been overlooked or lost:

Bob,

Replace PARK with a placeholder, do your replacement,

and restore the
PARKs. This will work as long as XXXX doesn't appear

anywhere in your
data set.

With Columns("B:B")
..Replace What:="PARK", Replacement:="XXXX",

LookAt:=xlPart
..Replace What:="PAR", Replacement:="PARK",

LookAt:=xlPart
..Replace What:="XXXX", Replacement:="PARK",

LookAt:=xlPart
End With

HTH,
Bernie
MS Excel MVP


"Bob C" wrote in

message
...
Hi Tom
I have just noticed in changing my question around, I
have deleted the part about doing this via macro.
Sorry and thankyou

Bob C

-----Original Message-----
I doubt that you can. Replace doesn't offer that

level
of sophistication to
the best of my knowledge.

You would have to write a macro with a specific
algorithm to identify this
situation and make the change.

--
Regards,
Tom Ogilvy

"Bob C" wrote in
message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the

retailers
as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on

the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C


.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace macro edeaston Excel Discussion (Misc queries) 3 January 12th 09 10:51 AM
Macro to Find and Replace R Storey Excel Discussion (Misc queries) 6 December 6th 06 07:04 PM
Macro to Find & Replace [email protected] Excel Worksheet Functions 2 September 14th 06 07:17 PM
Macro: Find and replace Bertie Excel Discussion (Misc queries) 1 May 29th 06 02:01 PM
Find & Replace in VB macro JackC Excel Discussion (Misc queries) 1 August 24th 05 09:22 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"