Using Wildcards

morganallen

New Member
Joined
Aug 11, 2011
Messages
5
Hi,


I have a spreadsheet full of data and I want to replace some cells with blanks but not all of them.

Essentially, anything with the word "blah" in it, I want to delete if not leave it unchanged (or call the cell back.)

IE - if A1 = Excel and A2 = Excelblah then A1 would remain unchanged while A2 was deleted.

Any thoughts on how to do this?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi
Welcome to the board

Try:

- select the area of the woksheet where you want to perform the replacements

- use Replace with

Find what: *blah*
Replace with: (leave empty)
 
Upvote 0
Hey, thanks for the tip, but that isn't quite what I am trying to do.

For example https://blog.mrexcel.com and I search for mrexcel and replace it with (blank) it returns https://blog..com. What I want it to do is erase the cell completely.

Something along the lines of this logic: If cell contains xyz, erase cell. If not, return value of cell.
 
Upvote 0
pgc01's method worked for me.

All cells that had blah as a sub-string were emptied.

What happened when you tried it and what did you want instead?
 
Upvote 0
pgc01's method worked for me.

All cells that had blah as a sub-string were emptied.

What happened when you tried it and what did you want instead?

if I have a cell "blahorg"

If I do the replace blah with (nothing), it will keep "org" in the cell when I want the entire cell erased.

Try: =IF(ISNUMBER(SEARCH("blah",A8,1)),"",A8)

That worked for what I was looking for.
 
Upvote 0
Hmm. the behaviour you desire is what happened for me using Search and Replace, i.e. lookfor blah* and a cell with myblahcell ends up empty. (Excel 2010)

I'm glad you found a solution.
 
Upvote 0
if I have a cell "blahorg"

If I do the replace blah with (nothing), it will keep "org" in the cell when I want the entire cell erased.

Hi again

I did not post replace

blah

with nothing, what I posted was replacing

*blah*

with nothing.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

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