View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cdb cdb is offline
external usenet poster
 
Posts: 62
Default Data validation of cells using code

I am currently working on a spreadsheet and several cells I need to have
validation on to only allow entry of either numbers or text only dependant on
which cell it is.

For example, in cell C5 I would like it to only allow text characters (no
numbers) and in C6 I would like it to only accept numbers or spaces (for a
phone number).

I have messed around with various attempts at using just the validation
worksheet functions, but it doesn't fill my requirements (ie for text, it
will still accept numbers so long as there is some text in it somewhere and
for the phone numbers I can't include spaces).

Is there any way I can put some code in to automatically check the entries
of these cells and validate as required?

Hope this all makes sense.

cdb