Replace ? deletes all data

noboffinme

New Member
Joined
Jun 30, 2011
Messages
13
Hi

I've tried to use the Replace function in VBA & then recording a macro to replace all the '?' in a column on a csv spreadsheet with a blank value.

The other values are numbers such as 1.7.

I find using replace deletes all the data in that column or if I select the whole spreadsheet, replace will replace all of the values.

The column datatype is General & I've tried enclosing the ? symbol in "" or '', but no success.

Does anyone know how I can replace a ? with an empty cell & what's going on here?

MS Excel version is 2007 if that helps. Cheers
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Because ? is a wildcard, it will replace everything if used on its own.
Try looking for the character value (chr(xx)) when doing the find/replace.
 
Upvote 0
The ? symbol has special meaning in the Replace dialog box... it is a wildcard standing for a single character. To find an actual ? symbol in your text, prefix it with a ~ symbol. So, this what you should put in the "Find what" field of the Replace dialog box...

~?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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