Dear VBA Gurus,
In my Excel workbook, I have a main/index sheet (worksheet 'Main') which essentially acts as a Navigation sheet for the entire workbook. The workbook has about 40 or so sheets, which can be categorized into 6 groups. I have created a click button for each of these 6 groups - and clicking any button displays a combo-box listing of the names of worksheets belonging to that group. For example, if a user selects 'ABC' from this combo-box list, he will be brought to worksheet 'ABC' (the click button macro should also scroll to cell A1 of worksheet 'ABC'), and so on. There is a also a 'Cancel' option in each combo-box list should a user wish to not select any worksheet in that group.
I have coded function insertCboPerfMgmt() below, which is called upon clicking button PerfMgmt_NavButton(). Although the combo-box object appears and is populated as expected - that is about all that goes right.
Two main problems I am facing are: The macro does NOT take me to the worksheet selected in the combo-box, and the combo-box object does not disappear or get 'destroyed' after the user has made his selection.
Plse advise what I am doing wrong... Hope I've described the problems in detail. Also do not assume any VBA knowledge on my part; I'm a total, absolute beginner!! Thanks a million in advance.
Sub insertCboPerfMgmt()
Set oleX = ActiveSheet
oleX.Shapes.AddOLEObject(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=125, Top:=200, Width:=180, Height:= _
16).Select
Selection.ListFillRange = "AA9:AA15"
End Sub
Sub PerfMgmt_NavButton()
Call insertCboPerfMgmt
Select Case ComboBox1.ListIndex + 1
Case 1
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("Deal_Search").Select
---> I need for Worksheets("Deal_Search") to SCROLL TO CELL A1
Case 2
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("M_to_M_Conduit").Select
Case 3
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("M_to_M_Losers").Select
Case 4
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("M_to_M_Detail").Select
Case 5
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("Deal_Analyst").Select
Case 6
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
ActiveWorkbook.Worksheets("DSAC_Approval").Select
Case 7
---> I need for ComboBox OLEObject to Disappear from worksheet Main!
End Select
End Sub
Display More