Any help please...

newclasshero

New Member
Joined
Sep 1, 2006
Messages
46
I am trying to get this code to return ONLY ONE of the following
B-OMS
B-GMS
EXEC
OTHER


Code:
If Sheets("V I S").Range("G4").Value = "BRYAN" Then
    Select Case Sheets("V I S").Range("C6").Value
        Case "Ford", "Lexus", "Chrysler"
            Sheets("V I S").Range("Q10").Value = "B-OMS"
        Case Else
            Sheets("V I S").Range("Q11").Value = "B-GMS"
    End Select

If Sheets("V I S").Range("G4") = "EXECUTIVE" Then
               Sheets("V I S").Range("Q12").Value = "EXEC"
    
Else
               Sheets("V I S").Range("Q13").Value = "OTHER"
End If
End If
End Sub

The Select Case part of the code works fine and returns either B-OMS or B-GMS which is what I want, however no matter what it runs through to the Else part of the code
Code:
Else
               Sheets("V I S").Range("Q13").Value = "OTHER"
and returns OTHER.

Any ideas how I am messing this up?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

jindon

MrExcel MVP
Joined
Aug 21, 2004
Messages
16,995
Hi
try
Code:
With Sheets("V I S")
   If UCase(.Range("G4").Value) = "BRYAN" Then
      Select Case UCase(.Range("C6").Value)
        Case "FORD", "LEXUS", "CHRYLER"
            .Range("Q10").Value = "B-OMS"
        Case Else
            .Range("Q11").Value = "B-GMS"
       End Select

   ElseIf UCase(.Range("G4").Value) = "EXECUTIVE" Then
        .Range("Q12").Value = "EXEC"
    
   Else
        .Range("Q13").Value = "OTHER"
   End If
End With
End Sub
 

Forum statistics

Threads
1,141,720
Messages
5,708,086
Members
421,545
Latest member
TWR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top