ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Checking for non-numerical content in a cell (https://www.excelbanter.com/excel-programming/274530-re-checking-non-numerical-content-cell.html)

Tom Ogilvy

Checking for non-numerical content in a cell
 
columns(6).SpecialCells(xlConstants,xlTextValues). ClearContents

Manually, select the column, do Edit=Goto = Special and select constants
and text

then edit=Clear=Contents

--
Regards,
Tom Ogilvy

Mike wrote in message
om...
I have a column in which a custom equation is entered. This equation
is defined by a macro (which I didn't create) and outputs the result
in the cell. Upon evaluating this column of equations, I am using
another macro to plot the data. The problem is that for some inputs,
the equation cannot produce a result and therefore displays a custom
error message that looks like:

[PSFLSH error 1]; one or more inputs are out of range: temperature
1.5 x upper limit, T = 1057.3 K, Tmax = 582.93 K

Since it is not an Excel error message, I don't think the normal
methods of searching for an error will work. Once the error occurs,
then for every row after it will also contain this error. So I want
to somehow have the macro identify where the error starts, and then
delete the contents of the cells from that point forward. Then I
should be able to plot the remaining data, even though I'll still be
referencing these blank cells. If I plot the entire range with these
error messages, then the plot shows the line dropping to zero from
then on which is something I don't want.

So how can I search through a column of data and delete only those
cells that contain non-numerical values? Any help would be greatly
appreciated. Thanks.

Mike





All times are GMT +1. The time now is 05:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com