Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I run several reports with ledger data and journal data. I added a right
click drop down allowing a user to look up journals from the ledger data. All works well except for .... I added a 'before close' piece of code to delete the drop down items - don't wish them to be there if the file is not in use. I assumed only one file would be open at a time - wrong. If a second file is opened and either the first or second is closed, the menu items go away. Is there an easy way to interrogate the open files and leave the drop down if a file that needs it is open? Module Code Sub see_journals() a = ActiveCell.Column X = ActiveCell.Value If a < 4 Or X = "" Then MsgBox "Please place your cursor on an account number." Exit Sub End If Worksheets("Journal Details").Select Range("Journal").Select Selection.AutoFilter Field:=5, Criteria1:=X End Sub Sub NewItem() On Error GoTo ONE If CommandBars("Cell").Controls("See Journals").Visible Then Exit Sub End If ONE: Dim ThisItem As Object Set ThisItem = CommandBars("Cell").Controls.Add With ThisItem ..Caption = "See Journals" ..OnAction = "See_Journals" ..BeginGroup = True End With End Sub Sub RidIt() On Error Resume Next CommandBars("Cell").Controls("See Journals").Delete End Sub ThisWorkbook Code Private Sub Workbook_BeforeClose(Cancel As Boolean) RidIt End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dropdown box display only data dependent on another dropdown box? | Excel Worksheet Functions | |||
Can't click on dropdown menu in excel, but others can. Help! | Excel Discussion (Misc queries) | |||
Disabling click and right-click on the Picture I inserted in an Excel document | Excel Worksheet Functions | |||
offer dropdown options based on another dropdown | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel |