Q:

Complie Error - Else without If VBA

I'm a newbie at vba so please excuse my ignorance.  I created a macro that will run through a dropdown list and print for each name in the dropdown - and it works:
Sub PrintAll()

  Dim Cell As Range
  Dim Rng As Range
  Dim Wks As Worksheet

  Set Wks = Worksheets("PRINT PAGE")
  Set Rng = ThisWorkbook.Names("Brokers").RefersToRange

  For Each Cell In Rng
    If Cell <> "" Then
       Wks.Range("$B$5").Value = Cell.Text
       Wks.PrintOut
    End If
  Next Cell

End Sub

However, the workbook has multiple worksheets to read from and therefore I need the vba to read from multiple ranges so I tried this  
Sub PrintAll()

  Dim Cell As Range
  Dim Cell2 As Range
  Dim Rng As Range
  Dim Wks As Worksheet

Set Wks = Worksheets("PRINT PAGE")

 If "$A$5" = "Company1" Then Rng = ThisWorkbook.Names("1Brokers").RefersToRange
 ElseIf "$A$5" = "Company2" Then Rng = ThisWorkbook.Names("2Brokers").RefersToRange
 Else: Set Rng = ThisWorkbook.Names("3Brokers").RefersToRange
 End If

  For Each Cell In Rng
    If Cell <> "" Then
       Wks.Range("$B$5").Value = Cell.Text
       Wks.PrintOut
    End If
  Next Cell

End Sub

The problem is I keep getting "Compile error Else without If" on the If statement.  Is there something wrong with how I'm setting up the If statement or with how I'm using it in the code?

A:

This block compiles for me. Please test it. I have always start set in the after then in if. 
Sub PrintAll()

  Dim Cell As Range
  Dim Cell2 As Range
  Dim Rng As Range
  Dim Wks As Worksheet

'Set Wks = Worksheets("PRINT PAGE")

 If "$A$5" = "Company1" Then
    Rng = ThisWorkbook.Names("1Brokers").RefersToRange
 ElseIf "$A$5" = "Company2" Then
    Rng = ThisWorkbook.Names("2Brokers").RefersToRange
 Else
    Set Rng = ThisWorkbook.Names("3Brokers").RefersToRange
 End If

  For Each Cell In Rng
    If Cell <> "" Then
       Wks.Range("$B$5").Value = Cell.Text
       Wks.PrintOut
    End If
  Next Cell

End Sub

