I have a simple workbook that I would like to limit the input in columns F,G, and H begining on row 3 of each to only a capitol N or Y. I would like to use code so it automatically changes to upper case. Is this possible?
I have a simple workbook that I would like to limit the input in columns F,G, and H begining on row 3 of each to only a capitol N or Y. I would like to use code so it automatically changes to upper case. Is this possible?
You may be able to avoid code by using data validation
IN the cell you want to control inputs select
Data / valaidation
Then choose "list" from the first drop down
Then enter Y,N in the 'Source' Box
This will force only two entries
"TJDeborah" wrote:
>
> I have a simple workbook that I would like to limit the input in columns
> F,G, and H begining on row 3 of each to only a capitol N or Y. I would
> like to use code so it automatically changes to upper case. Is this
> possible?
>
>
> --
> TJDeborah
> ------------------------------------------------------------------------
> TJDeborah's Profile: http://www.excelforum.com/member.php...o&userid=33186
> View this thread: http://www.excelforum.com/showthread...hreadid=530041
>
>
Hi TJDeborah
Try this in the worksheet's code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
With Target
If .Column < 6 Then Exit Sub
If .Column > 8 Then Exit Sub
If .Row < 3 Then Exit Sub
If .Value = "y" Or .Value = "n" Then
.Value = UCase(.Value)
Else
MsgBox "Only ""Y"" or ""N"" please."
.Select
.ClearContents
End If
End With
Application.EnableEvents = True
End Sub
Regards
Steve
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks