+ Reply to Thread
Results 1 to 14 of 14

Problems with Copy/Paste Code

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Problems with Copy/Paste Code

    I'm using code that SHG provided for me here; http://www.excelforum.com/showthread.php?t=630464

    It worked great in the first workbook I set up but I just set up a new workbook and it's not doing the same thing. For example, it allows me to copy items from column A which have 1 type of validation (restriction on text) to another column which has a formula validation.

    It still won't allow me to paste from outside a validated range to inside but I need to prevent people from screwing up the validation between columns. Any ideas?

    ChemistB
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Hello, Chemist,

    I got your note. The prior code verifies that the validation range is the same, but not that the validation itself is unchanged. That would require (I think) storing all the validation information in a static array at initialization, and then checking the validation following any change in the spreadsheet.

    I'm swamped this week, and won't have a chance to look at it until this weekend. Perhaps someone will jump in between now and then.

    Regards,

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Chemist, I hate to punt on you, but doing what I suggested seems like a pain in the neck -- or perhaps lower down ...

    Why not instead disable cut and paste (intercept Ctrl+v and purge the clipboard) and drag and drop (save state, disable, and resore on exit).

    Or maybe someone else will jump in with an easier solution ...

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    I'm fine with disabling the pasting and drag and drop functions if I just knew the code to write.

    ChemistB

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Hi all,
    Still looking for resolution here. I have a workbook with conditional formatting and data val in unprotected cells (for manual entry) and unexperienced Excel users. I've put in the instructions to use Paste Special Values but I know someone will accidently put data into the wrong column and cut and paste them to the other column thus screwing up the D.V and C.F.

    I'm not picky on how to do this; code that catches the person and doesn't allow paste or code that restores the original formatting (e.g. from a hidden sheet 2). Any thoughts? Thanks

    ChemistB

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    I still need help with this. I tried manually defining the validationrange name using commas to separate different types of vals but then it wouldn't even let me input a value. :-/

    Thanks in advance.

    ChemistB

+ 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