Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check user input
I need to check data in a range of 100 cells. The value can be blank or
single character only from these upper case letters (A, B, C, N, P, R, S, T, X, Y, Z). If the data is not correct prompt user to fix it. Is there better way to validate the cells that multiple if ..then .. else? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check user input
DataValidation
Choose List enter A,B,C,N,P,R,S,T,X,Y,Z (without any quotes) in Source Box Click OK Et voila! HTH -- AP " a écrit dans le message de ... I need to check data in a range of 100 cells. The value can be blank or single character only from these upper case letters (A, B, C, N, P, R, S, T, X, Y, Z). If the data is not correct prompt user to fix it. Is there better way to validate the cells that multiple if ..then .. else? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check user input
Set up data validation (Data-Validation) and in the settings tab, set Allow
drop-down to a List. You need to set up a list of valid values somewhere in your worksheet. Unfortunately data validation is not case sensitive (!) so in the past I have used the worksheet change event to replace the value entered to uppercase. You will need to change the references to those cells you wish to change and test e.g. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 And Target.Row = 1 And Target.Row <= 100 Then Target.Value = UCase(Target.Value) End If End Sub -- Cheers Nigel " wrote in message ... I need to check data in a range of 100 cells. The value can be blank or single character only from these upper case letters (A, B, C, N, P, R, S, T, X, Y, Z). If the data is not correct prompt user to fix it. Is there better way to validate the cells that multiple if ..then .. else? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check user input
Ardus solution is even better - I learn something everyday!
-- Cheers Nigel "Nigel" wrote in message ... Set up data validation (Data-Validation) and in the settings tab, set Allow drop-down to a List. You need to set up a list of valid values somewhere in your worksheet. Unfortunately data validation is not case sensitive (!) so in the past I have used the worksheet change event to replace the value entered to uppercase. You will need to change the references to those cells you wish to change and test e.g. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 And Target.Row = 1 And Target.Row <= 100 Then Target.Value = UCase(Target.Value) End If End Sub -- Cheers Nigel " wrote in message ... I need to check data in a range of 100 cells. The value can be blank or single character only from these upper case letters (A, B, C, N, P, R, S, T, X, Y, Z). If the data is not correct prompt user to fix it. Is there better way to validate the cells that multiple if ..then .. else? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prompt user for input and utilize that input | Excel Worksheet Functions | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
Check on the input in an inputbox | Excel Programming | |||
Check a user-input value against a list of values? | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |