+ Reply to Thread
Results 1 to 2 of 2

Drag and Drop Listboxes - with Class Module

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Drag and Drop Listboxes - with Class Module

    Hi there, I am not very good with understanding class modules.

    My goal is to create a drag and drop environment on a userform in which I can drag items from ListboxA, ListboxB or ListboxC as in my workbook example. Only allowing the items to be drop on ListboxD. Anything dragged from ListboxD could only be dropped on the listbox it originally came from. There will be a prefix in the item names to help distinguish this as in the sample workbook.

    The sample code attached, is code I found on another forum... I made a few slight modifications, mostly to load data for testing and to test for type name since I was receiving an error when controls other than listboxes were on the userform. The sample code currently allows drag and drop from/to any listbox on the userform.

    As I do not fully understand class modules, I am wondering if someone could help me to get closer to my goal.

    Thanks
    Craig
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-18-2012
    Location
    Surrey, BC
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Drag and Drop Listboxes - with Class Module

    I think I figured it out... not sure it is the best method but it seems to work.
    I added two if statements that looked at the source listbox name and the target listbox name.
    Anything from A, B or C can only go to D.
    Anything from D can only go back to where it came from.

    The code I added is between the <><><><><><>.


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Class Module to design a class based on an autoshape (arrow)
    By BluesEnd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2017, 07:23 AM
  2. Place code in userform, module or class module
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2017, 07:04 AM
  3. [SOLVED] Drag and Drop Dynamically using Class Module
    By SocratesJC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2017, 08:34 PM
  4. [SOLVED] ComboBox class .AddItem filled in class module
    By Jacques Grobler in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-03-2012, 05:48 AM
  5. Replies: 1
    Last Post: 08-30-2011, 02:23 AM
  6. Drag and Drop Multiple Items across listboxes
    By karan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2009, 07:46 AM
  7. Module vs Class Module
    By DCSwearingen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-13-2006, 07:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1