View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Kay Kay is offline
external usenet poster
 
Posts: 129
Default delete cell value if there is data validation error

Thanks for your quick response.

Actually what i am doing , i am comparing two sheets - sheet1 with sheet2
my input is in sheet1 and i update sheet2 by comparing sheet1.

i dont know some how it copies the value of sheet1 into sheet 2 even if
there is data validation.
For eg Phone number in sheet 2 is number format. ( Sheet 1 does not have
data validatation and dont want to put validation for that column for some
reason)
So incase if some one enters text in sheet 1 , it will copy that value and
add/update to sheet2 (when i run that compare macro).
so i want to check if there is invlalid data in the sheet 2 then delete that
data and leave cell value as blank.

Hope i explained well.
Thanks



"Mike H" wrote:

Hi,

What am I missing? If you have data validation on your worksheet then how
can a validated cell contain incorrect data?

Mike

"kay" wrote:

Hi
I have written macro to compare two sheets.

can any one help me to write macro -
if there is data validation error then delete the cell value (leave blank in
that cell)
so when i run this macro it should check for data validation and if there is
an error
say date field is entred incorrectly then it should delete that cell value
and leave the value blank.

Thanks a lot in advance!