+ Reply to Thread
Results 1 to 7 of 7

Drag 'n' Drop Control

  1. #1
    Registered User
    Join Date
    12-30-2020
    Location
    Athens, Hellas
    MS-Off Ver
    1997-2003
    Posts
    17

    Drag 'n' Drop Control

    In Excel/VBA, is there any way to drag'n'drop something from somewhere in a userfom to somewhere else in the userform ? For instance a listbox item to another listbox item's list etc. ?

    If not ;
    (a) is there a suggested way to overcome this,
    (b) does the "standalone VBA" (I believe it's VB.net) have a control of this sort ?

    Thank you in advance.
    Last edited by nikolis69; 02-13-2021 at 08:05 PM.

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Drag 'n' Drop Control

    Have a read of this;

    https://jkp-ads.com/Articles/ExcelUserformDragDrop.asp

  3. #3
    Registered User
    Join Date
    12-30-2020
    Location
    Athens, Hellas
    MS-Off Ver
    1997-2003
    Posts
    17

    Re: Drag 'n' Drop Control

    So, I guess it doesn't ... does it ? ... lol ...

    Thank you Croweater !

  4. #4
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Drag 'n' Drop Control

    It doesn't what?

  5. #5
    Registered User
    Join Date
    12-30-2020
    Location
    Athens, Hellas
    MS-Off Ver
    1997-2003
    Posts
    17

    Re: Drag 'n' Drop Control

    I checked the userform controls and their properties didn't seem to include anything relevant to dragging-dropping. But, novice as I am, I could be wrong.
    Yet the article you pointed out seems to need loads of code to overcome this. Which means that there is a solution but there really is no "simple" dragging-dropping, one you can assign with 5-10 lines of code, e.g. changing a state or a .Value or a .Position etc.

  6. #6
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Drag 'n' Drop Control

    I just came across the article on the way out and noticed it described your problem almost exactly.

    I didn't read it thoroughly apart from the first paragraph which said "One of the more difficult tasks in VBA programming is to enable drag and drop between two listboxes on a userform". It then goes on and gives you the code to do this (but I must admit I haven't read it all).

    This is EXACTLY what you want to do isn't it? What does it matter if you need 'loads of code' if someone else has done all the hard work for you?

    Have you even tried to copy and paste the bits of code in this article, which do what you want to do, into your workbook and tried it out?

    If you don't want to do that I guess you'll have to try one of the other solutions offered. Oh wait...

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,032

    Re: Drag 'n' Drop Control

    I think the only control which natively supports drag and drop is the toolbar.

+ 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. How to Control Drag and Drop? (force "shift" drag-drop, disable into certain rows)
    By superlative in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2019, 11:16 AM
  2. Replies: 1
    Last Post: 11-03-2018, 04:26 PM
  3. [SOLVED] Drag and Drop data using Treeview -Working great for the first drop, but locking on 2nd
    By graym463 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2016, 09:38 AM
  4. ListView Control / Drag&Drop / msghook
    By gooopil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2011, 01:08 PM
  5. Drag and Drop from ListView control to a cell
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2011, 07:16 PM
  6. Control over drag and drop from an Excel cell
    By wsfulton in forum Excel General
    Replies: 1
    Last Post: 01-03-2009, 07:52 PM
  7. Treeview Control Drag and Drop
    By MikeBrough in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2007, 10:42 AM

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