Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Help needed re: nested conditional formula

0 views
Skip to first unread message
Message has been deleted

smartin

unread,
Jun 27, 2009, 3:49:34 PM6/27/09
to
gcotterl wrote:
> If M6 contains "J" or "L"
> if the third character in M6 is a "-"
> I want S6 to contain ""X"
> else, I want S6 to contain "Y"
> else, I want S6 to contain "Z".
>
> How do I write the formula?


Option Explicit

Sub gcotterl()
Dim Check As String
Check = Range("M6").Value
If InStr(1, Check, "J") + InStr(1, Check, "L") > 0 Then
If Mid(Check, 3, 1) = "-" Then
Range("S6").Value = "X"
Else
Range("S6").Value = "Y"
End If
Else
Range("S6").Value = "Z"
End If
End Sub

0 new messages