Hello,
This has taken me a while to get to work, but I have code, triggered by a button click, that will remove data validation on all sheets in a workbook. I needed this functionality to be able to use the workbook on a SharePoint 2010 page.
You can then re-enable the data validation by clicking the button again, and it adds the validation back to all the cells that had it before.
I hope this might help some people who are trying to remove data validation for one reason or the other. I found several sites for adding it to a cell and making it dynamic, but I couldn’t find ones that easily explained how to remove it (completely) from a cell. I ran the a macro for removing data validation and then copied the code, but that didn’t work for the SharePoint site, because when you did a Find for Data Validation, it still found all the cells that had it. Call me daft, but I final tried this and it worked. Just a simple Selection.Validation.Delete, without all the extra commands after it. i.e, .Add Type :=xlValidateInputOnly, ….
I am a little disturbed about how long it takes to re-enable the data validation on the cells though, and I’m wondering if setting up an array or some other similar process might help speed it up.
Anyway, perhaps this may help someone else out there, but any response for speed enhancements would be appreciated.
Thanks
Bookmarks