maverickmonster
Programmer
I have an If statement in a VBA excel application but it does not seam to work properly, it does not seam to fire the right statements they must be done in this order could any one help or make any suggestions ?
Thanks
If (Sheets(1).Cells(X, 55) = "Y") Then
GoTo pro1
ElseIf (Sheets(1).Cells(X, 54) = "C" And Sheets(1).Cells(X, 56) = "N") Then
GoTo pro2
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "Y" And (Sheets(1).Cells(X, 45) = "I") Or (Sheets(1).Cells(X, 45) = "F") Then
GoTo pro3
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And (Sheets(1).Cells(X, 54) = "U") Or (Sheets(1).Cells(X, 54) = "C") And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "Y" And (Sheets(1).Cells(X, 56) = "N") Then
GoTo pro4
ElseIf (Sheets(1).Cells(X, 45) = "I") Or (Sheets(1).Cells(X, 45) = "F") Then
GoTo pro5
ElseIf ((Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C")) And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "F" Then
GoTo pro6
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "I" Then
GoTo pro7
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "N" Then
GoTo pro8
Thanks
If (Sheets(1).Cells(X, 55) = "Y") Then
GoTo pro1
ElseIf (Sheets(1).Cells(X, 54) = "C" And Sheets(1).Cells(X, 56) = "N") Then
GoTo pro2
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "Y" And (Sheets(1).Cells(X, 45) = "I") Or (Sheets(1).Cells(X, 45) = "F") Then
GoTo pro3
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And (Sheets(1).Cells(X, 54) = "U") Or (Sheets(1).Cells(X, 54) = "C") And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "Y" And (Sheets(1).Cells(X, 56) = "N") Then
GoTo pro4
ElseIf (Sheets(1).Cells(X, 45) = "I") Or (Sheets(1).Cells(X, 45) = "F") Then
GoTo pro5
ElseIf ((Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C")) And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "F" Then
GoTo pro6
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "I" Then
GoTo pro7
ElseIf (Sheets(1).Cells(X, 45) = "V") Or (Sheets(1).Cells(X, 45) = "C") And Sheets(1).Cells(X, 54) = "U" And Sheets(1).Cells(X, 55) = "N" And Sheets(1).Cells(X, 56) = "N" And Sheets(1).Cells(X, 45) = "N" Then
GoTo pro8