ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   If the user inputs lower case y/n answer How do I convert automat. (https://www.excelbanter.com/excel-discussion-misc-queries/12458-if-user-inputs-lower-case-y-n-answer-how-do-i-convert-automat.html)

jhg1226

If the user inputs lower case y/n answer How do I convert automat.
 
In Excel I have a column which asks for a Y or N response. If the user
inputs y or n in lower case Can I have Excel convert it to Upper Case?

Bernard Liengme

Use Data Validation to force user to input uppercase
But, Excel is not case sensitive so =IF(A1="Y", Dothis, Dothat) will give
DoThis for A1 = Y or y
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"jhg1226" wrote in message
...
In Excel I have a column which asks for a Y or N response. If the user
inputs y or n in lower case Can I have Excel convert it to Upper Case?




Jason Morin

Right-click the sheet tab, go to View Code, and insert
the code below:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Column = 1 Then '1 = col. A, 2 = col. B, etc.
If .Count = 1 Then
If .Value = "y" Or .Value = "n" And _
.Value = LCase(.Value) Then
Application.EnableEvents = False
.Value = UCase(.Value)
Application.EnableEvents = True
End If
End If
End If
End With
End Sub

----
Press ALT+Q to return to XL. The code is set to evaluate
entries in col. A (1). Change if necessary.

HTH
Jason
Atlanta, GA

-----Original Message-----
In Excel I have a column which asks for a Y or N

response. If the user
inputs y or n in lower case Can I have Excel convert it

to Upper Case?
.



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com