Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How change unprotected cell formats on protected worksheets?
I have a protected worksheet that allows users to manually input into
unprotected ranges, or manually copy from a protected range into an unprotected area. Copy from cells have different font and background colors that change the destination cell formats after paste even when sheet is protected. How do I restore the color formats of the destination cells after the changes are processed by an executed macro? The following works fine if sheet is unprotected, but gives error 1004 if protected: Range("destname").Interior.ColorIndex = 35 Range("destname").Font.ColorIndex = 1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How change unprotected cell formats on protected worksheets?
John,
It's funny that one - you can paste different formats into the cell on a protected sheet but you can't then change those cell's format!! Two suggestions - add code to: - unprotect the sheet - restore the formats (using your existing code) - re-protect the sheet or: - set up a range on another (hidden?) sheet the same size as your "destname" range, with the correct cell formats (fonts, borders etc). - copy this area and paste special just the formats to "destname" HTH Tim "John" wrote in message ... I have a protected worksheet that allows users to manually input into unprotected ranges, or manually copy from a protected range into an unprotected area. Copy from cells have different font and background colors that change the destination cell formats after paste even when sheet is protected. How do I restore the color formats of the destination cells after the changes are processed by an executed macro? The following works fine if sheet is unprotected, but gives error 1004 if protected: Range("destname").Interior.ColorIndex = 35 Range("destname").Font.ColorIndex = 1 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How change unprotected cell formats on protected worksheets?
Tim, I like the unprotect/copy/reprotect option! But I need the code to run
no matter whether the sheet is protected or not so I can debug changes. How do I tell in a macro whether or not the sheet is protected? -JHJ "Tim Barlow" wrote: John, It's funny that one - you can paste different formats into the cell on a protected sheet but you can't then change those cell's format!! Two suggestions - add code to: - unprotect the sheet - restore the formats (using your existing code) - re-protect the sheet or: - set up a range on another (hidden?) sheet the same size as your "destname" range, with the correct cell formats (fonts, borders etc). - copy this area and paste special just the formats to "destname" HTH Tim "John" wrote in message ... I have a protected worksheet that allows users to manually input into unprotected ranges, or manually copy from a protected range into an unprotected area. Copy from cells have different font and background colors that change the destination cell formats after paste even when sheet is protected. How do I restore the color formats of the destination cells after the changes are processed by an executed macro? The following works fine if sheet is unprotected, but gives error 1004 if protected: Range("destname").Interior.ColorIndex = 35 Range("destname").Font.ColorIndex = 1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to highlight an unprotected cell on a protected sheet. | Excel Worksheet Functions | |||
Adding comments to unprotected cell in a protected sheet | Excel Discussion (Misc queries) | |||
adding comments to unprotected cell/range in protected worksheet | Excel Worksheet Functions | |||
TAB and focus moving from unprotected cell in protected sheet til dropdown. | Excel Programming | |||
CELL PROTECTED IN 2000, UNPROTECTED IN 2003 | Excel Worksheet Functions |