Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Spaces and Data Validation
I put VBE code in for my data validation, example is below (it uses range
names). However, if the user enters a response manually (without using the drop down menu), the code doesn't reject extra spaces entered. So when I really need "Yes" for example, it takes "Yes " or " Yes". Am I doing something wrong in my code? If so, how can I fix this so that the user cannot add extra spaces (by adding the Application.Trim somewhere)? I have a large workbook with multiple areas affected, that is almost in its last stages of finalization (hopefully), so am praying this is a relatively easy thing to fix. Thanks for any help....Paige Example is: With Range("PM1_1,PM3_1,PM4_1,PM5_1,PM6_1").Validation .Delete .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:="Yes,No" .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "Invalid entry; please use the drop-down menu to select a response." .ShowInput = True .ShowError = True End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
custom data validation on cells with data validation values | Excel Worksheet Functions | |||
Spaces at the end of data | Excel Worksheet Functions | |||
Data Validation, Need text any length no spaces | Excel Discussion (Misc queries) | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
Spaces in Data | New Users to Excel |