+ Reply to Thread
Results 1 to 16 of 16

Drag and Drop

  1. #1
    Registered User
    Join Date
    12-20-2009
    Location
    Worcester
    MS-Off Ver
    Excel 2007
    Posts
    27

    Drag and Drop

    Hi Guy's, I'm wondering if anyone can help me here.

    How can I stop drag and drop across a row but you can drag and drop down a column. Is this possible? If so, how?

    Any help would be much appreciated.

    Thank You
    Jonah
    Last edited by Jonah; 01-14-2010 at 06:49 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Paste

    Jonah, if you click the fill handle, that is the little black square in the lower right corner of a cell, and drag either down or across, it will fill (and fill in a series if it recognises it)

    What behaviour do you want?

  3. #3
    Registered User
    Join Date
    12-20-2009
    Location
    Worcester
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Drag and Paste

    Quote Originally Posted by teylyn View Post
    Jonah, if you click the fill handle, that is the little black square in the lower right corner of a cell, and drag either down or across, it will fill (and fill in a series if it recognises it)

    What behaviour do you want?
    I want the handle to be only dragged up or down, not across.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Paste

    Educate the users, maybe?

    You can't have a car that steers only left, to avoid colliding with the oncoming traffic on the right.
    (that is for UK, OZ, ZA, JP and NZ and all the other places that drive on the wrong side of the road. Sorry. Still feels wrong after all these years)

    (European/US version: )
    You can't have a car that steers only right, to avoid colliding with the oncoming traffic on the left.
    Last edited by teylyn; 01-14-2010 at 06:40 AM.

  5. #5
    Registered User
    Join Date
    12-20-2009
    Location
    Worcester
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Drag and Paste

    Quote Originally Posted by teylyn View Post
    Educate the users, maybe?

    You can't have a car that steers only left, to avoid colliding with the oncoming traffic on the right.
    (that is for UK, OZ, ZA, JP and NZ and all the other places that drive on the wrong side of the road. Sorry. Still feels wrong after all these years)

    (European/US version: )
    You can't have a car that steers only right, to avoid colliding with the oncoming traffic on the left.
    Well Teylyn, unfortunately, it's very hard to educate these users as they are over 5000 miles away and have a tendency to ignore whats being said to them. I want to make the spreadsheet bomb proof and to not allow the dragging and dropping of cells across to other rows as that will destroy the data validation. I've already disabled copy and paste on the sheet. Its just this one area which I need to conquer.

    Help!!!

    Jon

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Drag and Drop

    This workbook prevents copying & pasting,and most importantly, restores it.
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Drop

    Neat, Roy! but I can still select the source cell and adjacent cells below or right and use Ctrl-D to copy down and Ctrl-R to copy right.
    Can that also be disabled?

  8. #8
    Registered User
    Join Date
    12-20-2009
    Location
    Worcester
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Drag and Drop

    Quote Originally Posted by royUK View Post
    This workbook prevents copying & pasting,and most importantly, restores it.
    Hi Roy, here is my code, so that copy and paste is disabled but drag and drop isn't. What I'm asking for is for the ability to disable drag and and drop across rows. However, I do want drag and drop to be enabled up and down the same column.

    Please Login or Register  to view this content.
    Any help would be much appreciated, thank you.

    Jonah

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Drag and Drop

    Quote Originally Posted by teylyn View Post
    Neat, Roy! but I can still select the source cell and adjacent cells below or right and use Ctrl-D to copy down and Ctrl-R to copy right.
    Can that also be disabled?
    Drag across to right doesn't work for me.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Drag and Drop

    Just amended the code & this seems to even stop Teylyn
    Please Login or Register  to view this content.

  11. #11
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Drop

    That's correct. Dragging is not possible in either direction. But I can select the source cell and the adjacent cells to the right and Ctrl-R to copy right.

  12. #12
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Drop

    this seems to even stop Teylyn
    LOL, I'll try this in the morning! Too late for experiments now!

    edit: tried just now. Can still select source and down and use Ctrl-D and can still select source and right and use Ctrl-R

    I'm glad I'm just the tester and not the coder!
    Last edited by teylyn; 01-14-2010 at 08:12 AM.

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Drag and Drop

    Quote Originally Posted by teylyn View Post
    LOL, I'll try this in the morning! Too late for experiments now!

    edit: tried just now. Can still select source and down and use Ctrl-D and can still select source and right and use Ctrl-R

    I'm glad I'm just the tester and not the coder!
    Did you run the amended code before testing?

    This stops Ctrl-R as well
    Please Login or Register  to view this content.

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Drag and Drop

    Quote Originally Posted by Jonah View Post
    Hi Roy, here is my code, so that copy and paste is disabled but drag and drop isn't. What I'm asking for is for the ability to disable drag and and drop across rows. However, I do want drag and drop to be enabled up and down the same column.
    Idon't think you can stop part of drag & drop

  15. #15
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Drag and Drop

    Did you run the amended code before testing?
    duh - it was too late last night. I ran it now and it's working. Just for the record and the benefit of others reading this: switching to other workbooks in 2007 or 2010 that do not have the copy restrictions, will turn everything back to normal, so it might be a good idea to put the code in a worksheet change event or some such.

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Drag and Drop

    Hello Jonah,

    The cell drag and drop function does not expose any VBA events which would be necessary to to control the direction. You can either have it enabled or disabled.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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