#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Cell protection

Is it possible to protect multiple cell ranges for different reasons? I
would like to protect certain cells to not allow any changes and I would like
to protect other ranges to allow data entry but not change the cell
formatting.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 108
Default Cell protection

Gregg Johnson wrote:
Is it possible to protect multiple cell ranges for different reasons? I
would like to protect certain cells to not allow any changes and I would like
to protect other ranges to allow data entry but not change the cell
formatting.

Thanks.


Hi Gregg

As far as I know, when protecting the worksheet, you can protect all
the cells from having their formats changed or none of them.

But try FormatConditional Formatting of the cells where you want to
allow editing but not format change e.g. In cell A1:
Formula Is =OR(A1="",A1<"")
Apply the Format you want.

This should override a format applied by a user as long as the cell
contains nothing or something!

Regards

Steve

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Cell protection

Steve -

Thank you for your response. I'm having a little trouble with it:

When I attempt to change the format in conditional formatting, it will not
allow me to select Font or Size, only Style and Color. Is this typical?
Users will paste information into these cells. When I did that, it removed
the conditional formatting and used the pasted format. Is that to be
expected?

Thanks.

"Scoops" wrote:

Gregg Johnson wrote:
Is it possible to protect multiple cell ranges for different reasons? I
would like to protect certain cells to not allow any changes and I would like
to protect other ranges to allow data entry but not change the cell
formatting.

Thanks.


Hi Gregg

As far as I know, when protecting the worksheet, you can protect all
the cells from having their formats changed or none of them.

But try FormatConditional Formatting of the cells where you want to
allow editing but not format change e.g. In cell A1:
Formula Is =OR(A1="",A1<"")
Apply the Format you want.

This should override a format applied by a user as long as the cell
contains nothing or something!

Regards

Steve


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 108
Default Cell protection


Gregg Johnson wrote:
Steve -

Thank you for your response. I'm having a little trouble with it:

When I attempt to change the format in conditional formatting, it will not
allow me to select Font or Size, only Style and Color. Is this typical?
Users will paste information into these cells. When I did that, it removed
the conditional formatting and used the pasted format. Is that to be
expected?

Thanks.


Hi Gregg

Yes, that's to be expected in both cases.

As a quick solution (I'm just about to finish for the day and this may
be the proverbial sledgehammer), try this:

Right-click the tab of the appropriate sheet View Code and paste
this:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
End Sub

Regards

Steve

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Cell protection

Wow - that works great. Thanks.

"Scoops" wrote:


Gregg Johnson wrote:
Steve -

Thank you for your response. I'm having a little trouble with it:

When I attempt to change the format in conditional formatting, it will not
allow me to select Font or Size, only Style and Color. Is this typical?
Users will paste information into these cells. When I did that, it removed
the conditional formatting and used the pasted format. Is that to be
expected?

Thanks.


Hi Gregg

Yes, that's to be expected in both cases.

As a quick solution (I'm just about to finish for the day and this may
be the proverbial sledgehammer), try this:

Right-click the tab of the appropriate sheet View Code and paste
this:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
End Sub

Regards

Steve




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 108
Default Cell protection


Gregg Johnson wrote:
Wow - that works great. Thanks.

Glad to help, just be aware that the macro will work on every cell in
the worksheet so, if you do have some cells that you would like to be
altered by a paste action, you'll need to restrict where the macro
works.

For example, if you do not want it to affect cells in column A or row 2
or cell B3 then something like:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myValue
If Target.Column = 1 Or _
Target.Row = 2 Or _
Target.Address = "$B$3" Then Exit Sub
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
End Sub

Regards

Steve

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
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Data validation, cell protection or other method? KG Excel Discussion (Misc queries) 5 June 17th 05 05:22 AM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
cell protection D Excel Discussion (Misc queries) 2 March 29th 05 10:58 AM


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