Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
Check on the input in an inputbox Tempy Excel Programming 5 May 17th 05 02:01 PM
Check a user-input value against a list of values? Bill_S Excel Programming 1 April 28th 05 03:24 AM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 10:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"