Search for spaces before

Manolocs

Active Member
Joined
Mar 28, 2008
Messages
340
Hello,

I am trying to edit a long spreadsheet, I try to search and replace a " ?" with a space before for "?" without space.

I am unable, I know I can find "~? " but them will show me all "?".

Any one have a better way to replace it?

Thanks in advance.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Does not work, "Can not find data you are looking for" message.
I was thinking in a formula to find :(
 
Upvote 0
Aladin's method works me, using Find and Replace.
In the Find, you should be entering space + tilde + question mark
and in the Replace, you should just be entering question mark

If it does not find anything, then I suspect that the space before your question mark isn't a normal space, but some special character. I see this a lot with data downloaded from the web and imported from other programs.

The first step is to determine what exactly that character is. You can do that by figuring out what number character that space resides in in your string, and applying the CODE function to it.

For example, suppose you had the string in cell A1:
How are you ?
The space before the question mark resides in the 12th position of that string. So we would use the following function to return the ASCII value of that character:
=CODE(MID(A1,12,1))

If you apply that methodology to an example of your data, what value does that formula return?
 
Last edited:
Upvote 0
That is a normal space, which means the methodology Aladin and I explained should work for you.

Make sure that you have selected the entire range that you want to apply this to, and have chosen the correct Options when using Find/Replace, such as making sure that the "Match entire cell contents" check box is NOT selected.
 
Upvote 0
for some reason it is working now, I clear all formats and worked.
Thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,215,540
Messages
6,125,405
Members
449,223
Latest member
Narrian

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