I created a combo box and button in Excel using VBA. I want my button to run an IF statement and based on the selection in the combo box to go to a different worksheet. But my current code is giving me a "object required" error when debugging.
Please help?
Here's my current code: `Sub Button9_Click() If DropDown13.Value = "Access Management" Then ThisWorkbook.Sheets("AccMA").Activate
ElseIf DropDown13.Value = "Audit Management" Then
ThisWorkbook.Sheets("AudMA").Activate
ElseIf DropDown13.Value = "Asset Management" Then
ThisWorkbook.Sheets("AssMA").Activate
ElseIf DropDown13.Value = "Benefits Realisation" Then
ThisWorkbook.Sheets("BenMA").Activate
ElseIf DropDown13.Value = "Business Continuity Management" Then
ThisWorkbook.Sheets("BCMA").Activate
ElseIf DropDown13.Value = "Business Process Management" Then
ThisWorkbook.Sheets("BPMA").Activate
ElseIf DropDown13.Value = "Capacity Management" Then
ThisWorkbook.Sheets("CAPA").Activate
ElseIf DropDown13.Value = "Catalogue Management" Then
ThisWorkbook.Sheets("CATA").Activate
ElseIf DropDown13.Value = "Change Management" Then
ThisWorkbook.Sheets("CNGA").Activate
ElseIf DropDown13.Value = "Communications Management" Then
ThisWorkbook.Sheets("COMA").Activate
ElseIf DropDown13.Value = "Compliance Management" Then
ThisWorkbook.Sheets("COPA").Activate
End If
End Sub`
Aucun commentaire:
Enregistrer un commentaire