Vba - if .... then elseif

Post date: Feb 3, 2011 11:24:58 PM

Public Sub go_index()

Sheets("home").Select

variable = Range("var").Value

If variable = "2" Then

Sheets("var 2").Select

ElseIf variable = "3" Then

Sheets("var 3").Select

ElseIf variable = "4" Then

Sheets("var 4").Select

End If

Range("A1").Select

End Sub