Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
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
Unable to highlight an unprotected cell on a protected sheet. Del[_2_] Excel Worksheet Functions 1 September 4th 08 02:04 PM
Adding comments to unprotected cell in a protected sheet Dave Excel Discussion (Misc queries) 3 February 8th 06 10:59 PM
adding comments to unprotected cell/range in protected worksheet gone fishing Excel Worksheet Functions 0 February 8th 06 10:06 PM
TAB and focus moving from unprotected cell in protected sheet til dropdown. Claus[_3_] Excel Programming 0 August 26th 05 11:28 AM
CELL PROTECTED IN 2000, UNPROTECTED IN 2003 Carole O Excel Worksheet Functions 0 January 20th 05 07:17 PM


All times are GMT +1. The time now is 10:38 PM.

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

About Us

"It's about Microsoft Excel"