A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Bokkisam!
Thank you for the feedback.
Perhaps, you can use VBA (Visual Basic for Applications) code to automate the process of applying data validation every time the workbook is opened
Here's an example of how you can do this: Open your workbook and press Alt + F11 to open the VBA editor.
In the editor, double-click on the "ThisWorkbook" object in the Project Explorer window to open the code window for that object.
In the code window, paste the following code: Private Sub Workbook_Open() Dim rng As Range Set rng = Range("A1:A10") 'Replace A1:A10 with the range you want to apply data validation to With rng. Validation . Delete 'delete any existing validation . Add Type:=xlValidateWholeNumber, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="1", Formula2:="100" 'replace with your data validation settings . IgnoreBlank = True . InCellDropdown = True . InputTitle = "" . ErrorTitle = "" . InputMessage = "" . ErrorMessage = "" . ShowInput = True . ShowError = True End With End Sub Replace "A1:A10" with the range you want to apply data validation to.
Replace the validation settings in the . Add method with the settings you want to apply to the range.
Save the VBA code and close the VBA editor.
Now, every time the workbook is opened, the data validation rule will be automatically applied to the specified range. Note that the user will need to enable macros in order for this to work.
Kind Regards, Shakiru