Find cells that start with a specific text and replace with

acargo

New Member
Joined
Oct 27, 2017
Messages
9
Hi all,


I am pretty sure I've been able to use the find and replace function for this before; I have a complete brain freeze.

I have a lot of entries on excel; they are urls. Some of them have the root domain included and some don't. for example:

www.example.com/product123
/product435
/product987
www.example.com/product435

and so on.

I want to find those that have www.example.com and replace them so I only have /product and the number behind (for example /product123). What wildcard can I use to do this please? I've tried several things without success.

Any help on this would be much appreciated.

thanks,
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi,

the SUBSTITUTE function ?

=SUBSTITUTE(YourEntry, "www.example.com", "")

with VBA :

Code:
Replace(YourRange, "[URL="http://www.example.com"]www.example.com[/URL]", "")

Or you can just press Ctrl+H in your worksheet and use the replace tool :)

Hope it helped
 
Last edited:
Upvote 0
Hi louisH,

That worked nicely. Thank you :)

Do you know if there's a way to do it through the find and replace though?

A.
 
Upvote 0
Are you looking for a macro to do this ?

One equivalent of the replace tool (Ctrl+H) in VBA is :

Code:
    ActiveSheet.UsedRange.Replace What:="[URL="http://www.example.com"]www.example.com[/URL]", Replacement:=""
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,634
Messages
6,125,934
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top