LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default If/Then ... what am I missing

Looks like a case for Select Case to me

Select Case affirmation
Case ""
Select Case indirect
Case ""
Select Case direct
Case "": CalPrac = "NI"
Case "x": CalPrac = "PI"
Case "w": CalPrac = "PI"
Case "m": CalPrac = "NI"
Case "ny": CalPrac = "NY"
End Select
Case "x"
Select Case direct
Case "": CalPrac = "PI"
Case "x": CalPrac = "FI"
Case "w": CalPrac = "LI"
Case "m": CalPrac = "PI"
Case "ny": CalPrac = "NY"
End Select
Case "m"
Select Case direct
Case "": CalPrac = "NI"
Case "x": CalPrac = "PI"
Case "w": CalPrac = "PI"
Case "m": CalPrac = "NI"
Case "ny": CalPrac = "NY"
End Select
End Select
Case "x"
Select Case indirect
Case ""
Select Case direct
Case "": CalPrac = "NI"
Case "x": CalPrac = "FI"
Case "w": CalPrac = "LI"
Case "m": CalPrac = "NI"
Case "ny": CalPrac = "NY"
End Select
Case "x"
Select Case direct
Case "": CalPrac = "PI"
Case "x": CalPrac = "FI"
Case "w": CalPrac = "LI"
Case "m": CalPrac = "PI"
Case "ny": CalPrac = "NY"
End Select
Case "m"
Select Case direct
Case "": CalPrac = "NI"
Case "x": CalPrac = "FI"
Case "w": CalPrac = "LI"
Case "m": CalPrac = "NI"
Case "ny": CalPrac = "NY"
End Select
End Select
End Select




--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Barb Reinhardt" wrote in message
...
I have the following if/Then statements

If affirmation = "" Then
If indirect = "" Then
If direct = "" Then CalPrac = "NI"
ElseIf direct = "x" Then CalPrac = "PI"
ElseIf direct = "w" Then CalPrac = "PI"
ElseIf direct = "m" Then CalPrac = "NI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
ElseIf indirect = "x" Then
If direct = "" Then CalPrac = "PI"
ElseIf direct = "x" Then CalPrac = "FI"
ElseIf direct = "w" Then CalPrac = "LI"
ElseIf direct = "m" Then CalPrac = "PI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
ElseIf indirect = "m" Then <~~Compile error, else without if
If direct = "" Then CalPrac = "NI"
ElseIf direct = "x" Then CalPrac = "PI"
ElseIf direct = "w" Then CalPrac = "PI"
ElseIf direct = "m" Then CalPrac = "NI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
End If
ElseIf affirmation = "x" Then
If indirect = "" Then
If direct = "" Then CalPrac = "NI"
ElseIf direct = "x" Then CalPrac = "FI"
ElseIf direct = "w" Then CalPrac = "LI"
ElseIf direct = "m" Then CalPrac = "NI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
ElseIf indirect = "x" Then
If direct = "" Then CalPrac = "PI"
ElseIf direct = "x" Then CalPrac = "FI"
ElseIf direct = "w" Then CalPrac = "LI"
ElseIf direct = "m" Then CalPrac = "PI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
ElseIf indirect = "m" Then
If direct = "" Then CalPrac = "NI"
ElseIf direct = "x" Then CalPrac = "FI"
ElseIf direct = "w" Then CalPrac = "LI"
ElseIf direct = "m" Then CalPrac = "NI"
ElseIf direct = "ny" Then CalPrac = "NY"
End If
End If
End If


I've noted where the error is. I just don't see it. I'm sure another
pair
of eyes will find it.

Thanks,
Barb Reinhardt



 
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
#missing! Arne Hegefors Excel Worksheet Functions 2 October 15th 08 05:50 PM
Missing OCX or DLL... Pierre Archambault Excel Programming 0 September 15th 06 09:17 PM
Toolbars Missing, And option to Add Missing SmeetaG Excel Discussion (Misc queries) 3 October 19th 05 11:43 AM
On Error? Creates 1 missing worksheet then never detects any other missing worksheets Craigm[_35_] Excel Programming 2 August 1st 05 02:39 PM
What am I missing here....? swatsp0p[_2_] Excel Programming 3 February 16th 05 01:59 PM


All times are GMT +1. The time now is 06:02 PM.

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

About Us

"It's about Microsoft Excel"