ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   2 Part Formula (https://www.excelbanter.com/excel-worksheet-functions/149682-2-part-formula.html)

Ashley

2 Part Formula
 
I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers, characters,
etc.). HELP!?

David Biddulph[_2_]

2 Part Formula
 
Try Data Validation.
--
David Biddulph

"ashley" wrote in message
...
I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers,
characters,
etc.). HELP!?




Toppers

2 Part Formula
 
Data =Validation

Allow: List

Source: S,B

"ashley" wrote:

I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers, characters,
etc.). HELP!?


PCLIVE

2 Part Formula
 
You could use Data-Validation.
Allow:
List
Source:
B,S

That should do what you want.

HTH,
Paul



"ashley" wrote in message
...
I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers,
characters,
etc.). HELP!?




Teethless mama

2 Part Formula
 
Data Validation Allow: Custom Formula:
=AND(OR(CODE(A1)=66,CODE(A1)=83),LEN(A1)=1)


"ashley" wrote:

I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers, characters,
etc.). HELP!?


Peo Sjoblom

2 Part Formula
 
You are using B's and S's does that mean you can allow for instance BS or
BBBB or SSSS etc?


--
Regards,

Peo Sjoblom



"ashley" wrote in message
...
I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers,
characters,
etc.). HELP!?




Mike H

2 Part Formula
 
Ashley,

For multiple Bs & Ss I had to resort to a macro:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
For x = 1 To Len(Target.Value)
If Mid(Target.Value, x, 1) = "B" Or Mid(Target.Value, x, 1) =
"S" Then
Else
MsgBox ("Illegal entry, Capital B or S only")
Target.Value = ""
End If
Next
End If
End Sub

Mike

"ashley" wrote:

I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers, characters,
etc.). HELP!?


Elkar

2 Part Formula
 
Here's a Custom Data Validation Formula that can allow for multiple B's and
S's.

=LEN(SUBSTITUTE(SUBSTITUTE(A1,"B",""),"S",""))=0

HTH,
Elkar


"Mike H" wrote:

Ashley,

For multiple Bs & Ss I had to resort to a macro:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
For x = 1 To Len(Target.Value)
If Mid(Target.Value, x, 1) = "B" Or Mid(Target.Value, x, 1) =
"S" Then
Else
MsgBox ("Illegal entry, Capital B or S only")
Target.Value = ""
End If
Next
End If
End Sub

Mike

"ashley" wrote:

I need a formula that, once locked, the cells in Column A will only accept
uppercase B's or S's and nothing else (no other letters, numbers, characters,
etc.). HELP!?


Peo Sjoblom

2 Part Formula
 
Nice


Peo


"Elkar" wrote in message
...
Here's a Custom Data Validation Formula that can allow for multiple B's
and
S's.

=LEN(SUBSTITUTE(SUBSTITUTE(A1,"B",""),"S",""))=0

HTH,
Elkar


"Mike H" wrote:

Ashley,

For multiple Bs & Ss I had to resort to a macro:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
For x = 1 To Len(Target.Value)
If Mid(Target.Value, x, 1) = "B" Or Mid(Target.Value, x, 1) =
"S" Then
Else
MsgBox ("Illegal entry, Capital B or S only")
Target.Value = ""
End If
Next
End If
End Sub

Mike

"ashley" wrote:

I need a formula that, once locked, the cells in Column A will only
accept
uppercase B's or S's and nothing else (no other letters, numbers,
characters,
etc.). HELP!?





All times are GMT +1. The time now is 08:45 PM.

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