+ Reply to Thread
Results 1 to 4 of 4

Prevent certain cells from being copied

  1. #1
    Registered User
    Join Date
    08-22-2005
    Posts
    7

    Question Prevent certain cells from being copied

    Does anyone have an idea on how to prevent a preselected cell in a defined area from being copied (copy and paste) into another document such as WORD?

    For example: Ignore the content of cell B2 in the selected A1:C3 range.

    Or maybe the way is to not be able to "highlight" the specific cell, therfore blocking it from being copied.

    Thanks for your help;

    Stephane

  2. #2
    Peter T
    Guest

    Re: Prevent certain cells from being copied

    > Or maybe the way is to not be able to "highlight" the specific cell,
    > therfore blocking it from being copied.


    You could try that. Start by unlocking all cells. Select the small square
    that intersects row/column headers, Format / Protection. Now lock A1:C3 and
    protect the Sheet (Tools Protection).

    In your VBE (alt-F11) find your project, expand and select the worksheet
    module. In properties (F4) change EnableSelection to 1- xlUnlockedCells.

    Plenty of ways to circumvent though, eg copy the Worksheet elsewhere.

    Regards,
    Peter T

    "morins" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Does anyone have an idea on how to prevent a preselected cell in a
    > defined area from being copied (copy and paste) into another document
    > such as WORD?
    >
    > For example: Ignore the content of cell B2 in the selected A1:C3
    > range.
    >
    > Or maybe the way is to not be able to "highlight" the specific cell,
    > therfore blocking it from being copied.
    >
    > Thanks for your help;
    >
    > Stephane
    >
    >
    > --
    > morins
    > ------------------------------------------------------------------------
    > morins's Profile:

    http://www.excelforum.com/member.php...o&userid=26522
    > View this thread: http://www.excelforum.com/showthread...hreadid=541315
    >




  3. #3
    Registered User
    Join Date
    08-22-2005
    Posts
    7
    Thanks for the tip, Peter. Now I have to find a way to make sure that when I change EnableSelection to 1- xlUnlockedCells it remains this way after saving the file.

  4. #4
    Peter T
    Guest

    Re: Prevent certain cells from being copied

    I always forget about that! Could reset in the Workbook open event though
    would need to error trap in case sheet no longer exists or renamed (I
    suppose not if the sheet is protected, codename perhaps).

    Another thing you could do is in the Worksheet module

    Private Sub Worksheet_Activate()
    Me.EnableSelection = xlUnlockedCells
    End Sub

    This incidentally will solve the immediate problem I mentioned if the sheet
    is copied elsewhere. There's probably more you can do, perhaps similar in
    other events. But there's always going to be some way the user can copy your
    data, eg with a simple vba routine.

    Regards,
    Peter T

    "morins" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Thanks for the tip, Peter. Now I have to find a way to make sure that
    > when I change EnableSelection to 1- xlUnlockedCells it remains this way
    > after saving the file.
    >
    >
    > --
    > morins
    > ------------------------------------------------------------------------
    > morins's Profile:

    http://www.excelforum.com/member.php...o&userid=26522
    > View this thread: http://www.excelforum.com/showthread...hreadid=541315
    >




+ 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