Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Pasting into protected cells

Is it possible to "protect" cells in a row such that when you are
pasting a group of cells into that row, the protected cells are
skipped over?

Example:

I want to paste this:
Columns
A B C
d1 d2 d3

into this:
Columns
A B C
p

p="protected" cell


so it looks like this:
Columns
A B C
d1 p d3


Is this possible with Excel as it is? With a script or macro?

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 269
Default Pasting into protected cells

I think you would have to go the macro route and check each cell.

This sample uses the Locked/Unlocked Status of the target cell as the
trigger. If the sheet is protected, it will need to be unprotected first.

Sheets("Sheet2").unprotect password:="Password"
If no password is used you dont need the password part.

To protect use
Sheets("Sheet2").protect password:="Password"

You may want to use the macro recorder to get the exact code for all of your
particular protection options. The recorded will not capture the password
entry and you will have to add that manually.

Sub pasteonlyopen ()
'UNPROTECT HERE IF NEEDED
For C=1 to 3

If Sheets("Sheet2").cells (1,C).locked=false then
Sheets("Sheet2").cells(1,C)=Sheets("Sheet1").cells (1,C)
Else
Sheets("Sheet2").cells(1,C)="P"
End If
Next C
'REPROTECT HERE
End Sub
--
If this helps, please remember to click yes.


"Alfred" wrote:

Is it possible to "protect" cells in a row such that when you are
pasting a group of cells into that row, the protected cells are
skipped over?

Example:

I want to paste this:
Columns
A B C
d1 d2 d3

into this:
Columns
A B C
p

p="protected" cell


so it looks like this:
Columns
A B C
d1 p d3


Is this possible with Excel as it is? With a script or macro?

Thanks!

.

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
Edit text format in non-protected cells in protected worksheet Bonnie Excel Discussion (Misc queries) 2 April 19th 08 04:48 PM
Pasting to Protected Cells in Xl2000 -VMill Excel Discussion (Misc queries) 3 August 17th 06 03:30 PM
keeping cells locked and protected when copying and pasting Lynne...... Excel Discussion (Misc queries) 0 June 19th 06 12:11 PM
Protect unlocked cells in a protected worksheet from cut/pasting Jerry NeSmith Excel Discussion (Misc queries) 0 November 29th 05 09:01 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM


All times are GMT +1. The time now is 03:53 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"