![]() ![]() Private Sub DeleteFromList_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean) Public WithEvents DeleteAll As CommandBarButton Public WithEvents DeleteFromList As CommandBarButton Public WithEvents DecreaseFont As CommandBarButton Public WithEvents IncreaseFont As CommandBarButton Codes of this class : Public LBox As MSForms.ListBox We added a class to VBE (Visual Basic Editor) to create the listbox context (right click) menu. There are four menu items in the menu that displayed when right-clicking on Listbox3 : We created a listbox context (right-click) menu that working on the Listbox3. Thus, the duplicate recording is prevented. If VBA codes above are examined, it is seen that if the item to be moved already exists, a warning is given with msgbox and no action is taken. ![]() MsgBox "This item already exists in ListBox3", vbCritical, "" 'With the For-Next loop, it checks whether the item already exists. Private Sub ListBox3_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer) Private Sub ListBox3_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer) Private Sub ListBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |