Removing text from cells in a spreadsheet

rickcb

New Member
Joined
Oct 23, 2006
Messages
23
I deal with very large spreadsheets containing extracted process data from a data logger(25000 rows and 250 columns) with Excel 2007. Some of the cells contain text messages indicating an error message recieved from the data logger. I would like to be able to remove this text from the cells and leave the cells blank automatically (with a macro that loads every time I open Excel).

Thanks in advance for your help.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I will be collecting this data from many different sources. Therefore, the error messages will be different from time to time. I was looking for something generic i.e any text appearing in the cell have to be removed, keeping only the numeric cells.
 
Upvote 0
something like the below you mean ?

Code:
Dim rng As Range
Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants, xlTextValues)
rng.ClearContents
 
Upvote 0
That's somewhat what I'm looking for. I would like to choose the range of cells before I execute the code and have the macro replace the text into the selected range?

Thanks,
 
Upvote 0
even simpler

Code:
Selection.SpecialCells(xlCellTypeConstants, xlTextValues).ClearContents
 
Upvote 0
Thanks,

That's exactly what I've been looking for. That'll save me tons of time.

Rick
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

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