Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
morins
------------------------------------------------------------------------
morins's Profile: http://www.excelforum.com/member.php...o&userid=26522
View this thread: http://www.excelforum.com/showthread...hreadid=541315

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prevent certain cells from being copied


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
prevent cell from being copied Frank Excel Discussion (Misc queries) 1 March 2nd 10 08:45 PM
Can I prevent a spreadsheet from being copied? Nest Egg George Excel Discussion (Misc queries) 2 December 31st 09 12:30 AM
prevent copied blank cells from replacing existing data lilleke Excel Worksheet Functions 10 August 28th 07 09:26 PM
how to prevent blank cell copied when combining cells? Vicneswari Murugan Excel Discussion (Misc queries) 2 August 18th 05 01:50 PM
how do I prevent a worksheet from being copied in excel kensanjose Excel Discussion (Misc queries) 4 July 8th 05 01:23 PM


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"