+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : Paste Value

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    24

    Paste Value

    I have a spreadsheet that is used to collect information, ie, a form with data entry fields. I lock all the fields that should not change, and protect the worksheet. This works great except that I can't stop people from pasting into the fields that are not locked. I would be fine if they pasted/value only. Does anyone know a way in VB to ensure that ALL pastes to a worksheet automatically and only use Paste/Value feature?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Paste Value

    use data validation to restrict entry in those cells to values only
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Paste Value

    I have data validation for my numeric fields as "whole number, greater than or equal to 0". However, if the user pastes a green background with .8 thick lines, it will paste numeric only data, but mess up the color and border formatting. Any other thoughts?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Paste Value

    when you set sheet protection, did you uncheck "format cells"? check under there and uncheck whatever you need the user to not have access too?

  5. #5
    Registered User
    Join Date
    06-05-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Paste Value

    Yes, the only thing the user can do is "Select locked cells" or "Select unlocked cells". The Select locked cells is checked because I use the "Comments" as mouse-over pop-up instructions.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Paste Value

    hmm ok, got me stumped, sorry

    bump?

  7. #7
    Registered User
    Join Date
    06-05-2012
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Paste Value

    Anyone have any thoughts on a approach?

  8. #8
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Paste Value

    Perhaps:
    Please Login or Register  to view this content.
    Edit: Sorry I didn't read more about the colour backgrounds but I'm sure that that can be worked into the worksheet change event.
    Last edited by Mordred; 06-08-2012 at 08:35 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  9. #9
    Forum Contributor tkowal's Avatar
    Join Date
    11-20-2010
    Location
    Miami, Fl
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Paste Value

    A thought came to mind, sort of a work around :

    What if in the change event, you trap cells of concern... copy the target's value.... issue an undo and re-assign the value....

    perhaps something along these lines: (Note: this is not tested)

    Please Login or Register  to view this content.
    After a quick test on a sheet with cell formats, backgrounds and borders... it seemed to work...
    Last edited by tkowal; 06-12-2012 at 10:24 AM. Reason: Did a quick test
    Ted
    "Live Long and Prosper"

+ 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