Number Validation

T

Tim

I have set columns to data->Validation, Formula-Custom, Formula=ISNUMBER(M:M) for say row M. The foemula does not allow me to enter text into the cells which is good but this column pull data from other sheets with a macro and it will take the text then. How can i have a column have and accept only numbers.
 
F

Frank Kabel

Tim said:
I have set columns to data->Validation, Formula-Custom,
Formula=ISNUMBER(M:M) for say row M. The foemula does not allow me to
enter text into the cells which is good but this column pull data
from other sheets with a macro and it will take the text then. How
can i have a column have and accept only numbers.

Hi Tim
one way: adapt the macro to test for text values for this cell.

Frank
 
F

Frank Kabel

Hi Tim
as I don't know your code its difficult to say but somethere in the
code should be an insertion method. In this part of the code you have
to check if the entry is valid or not.
Another way would be to create a separate macro which will test your
column after the insertion and deletes invalid entries.

Frank
 
T

Tom Ogilvy

if isnumeric(mydata) then
Range("M1").Value = mydata
else
' mydata contains non numeric information
' do nothing
End if
 
Top