Hello, I have 7 different sheets that I want the combo drop down box to open based on the number in cell C50 in a separate control sheet. I have the following code written although keep getting an error "Compile error: Block If without End If"
any help is greatly appreciated!
Sub DropDown4_Change()
Dim intType As Integer
intType = Range("C50").Value
If intType = 2 Then
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Range("A1").Select
If intType = 3 Then
Sheets("Sheet3").Visible = True
Sheets("Sheet3").Select
Range("A1").Select
If intType = 4 Then
Sheets("Sheet4").Visible = True
Sheets("Sheet4").Select
Range("A1").Select
If intType = 5 Then
Sheets("Sheet5").Visible = True
Sheets("Sheet5").Select
Range("A1").Select
If intType = 6 Then
Sheets("Sheet6").Visible = True
Sheets("Sheet6").Select
Range("A1").Select
If intType = 7 Then
Sheets("Sheet7").Visible = True
Sheets("Sheet7").Select
Range("A1").Select
ElseIf intType = 8 Then
Sheets("Sheet8").Visible = True
Sheets("Sheet8").Select
Range("A1").Select
End If
End Sub
any help is greatly appreciated!
Sub DropDown4_Change()
Dim intType As Integer
intType = Range("C50").Value
If intType = 2 Then
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Range("A1").Select
If intType = 3 Then
Sheets("Sheet3").Visible = True
Sheets("Sheet3").Select
Range("A1").Select
If intType = 4 Then
Sheets("Sheet4").Visible = True
Sheets("Sheet4").Select
Range("A1").Select
If intType = 5 Then
Sheets("Sheet5").Visible = True
Sheets("Sheet5").Select
Range("A1").Select
If intType = 6 Then
Sheets("Sheet6").Visible = True
Sheets("Sheet6").Select
Range("A1").Select
If intType = 7 Then
Sheets("Sheet7").Visible = True
Sheets("Sheet7").Select
Range("A1").Select
ElseIf intType = 8 Then
Sheets("Sheet8").Visible = True
Sheets("Sheet8").Select
Range("A1").Select
End If
End Sub