Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protecting Formulas in Tables

In Excel 2007 I have a formatted table, 10 columns wide, in which 5 of the
columns have formulas.

There is a nice feature in Excel 2007 that allows me to type a value in a
cell which is directly beneath the table and the table then expands to
€śconsume€ť that value and automatically fills the remaining columns in the
table with, where appropriate, the formulas.

I want to protect the table so that the formulas are not inadvertently
overwritten AND take advantage of this feature.

However, if I lock and hide the cells, then Protect the worksheet, this
feature is disabled.

Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 376
Default Protecting Formulas in Tables

Hi Hugh

The only way to do this is to resize your table first.
Click within tableDesign tabResizemake the table as large as you are
likely to need.
Select the cells where you want to enter dataFormatProtectionremove
Locked.
Right click on sheet tabProtect sheet.

The disadvantage of course is that if you are using the table as a
source for other things e.e Pivot Table, then the range will contain
lots of blank rows.

The only other way is via code.
The following event code was written for a Table called Table2
Data is entered in columns A and B, and columns C and D contain formulae.
You would need to amend to suit your situation.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim tr As Long
tr = Target.Row
If Target.Count 1 Then Exit Sub
If tr = 1 Then Exit Sub
If Target.Column < 1 Then Exit Sub
ActiveSheet.Unprotect
ActiveSheet.ListObjects("Table2").Resize Range("$A$1:$D" & tr)
Range(Cells(tr + 1, "A"), Cells(tr + 1, "B")).Locked = False
ActiveSheet.Protect
End Sub

To install
Copy code as above
Right click on sheet tabView Code
Paste code into white pane that appears
Alt+F11 to return to Excel
--
Regards
Roger Govier

Hugh wrote:
In Excel 2007 I have a formatted table, 10 columns wide, in which 5 of the
columns have formulas.

There is a nice feature in Excel 2007 that allows me to type a value in a
cell which is directly beneath the table and the table then expands to
€śconsume€ť that value and automatically fills the remaining columns in the
table with, where appropriate, the formulas.

I want to protect the table so that the formulas are not inadvertently
overwritten AND take advantage of this feature.

However, if I lock and hide the cells, then Protect the worksheet, this
feature is disabled.

Can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Protecting Formulas in Tables

Thanks for the help.

It's disappointing that these two functions won't work in harmony.

I've elected to leave the formulas unprotected and, if they get overwritten
they can be repaired.

"Roger Govier" wrote:

Hi Hugh

The only way to do this is to resize your table first.
Click within tableDesign tabResizemake the table as large as you are
likely to need.
Select the cells where you want to enter dataFormatProtectionremove
Locked.
Right click on sheet tabProtect sheet.

The disadvantage of course is that if you are using the table as a
source for other things e.e Pivot Table, then the range will contain
lots of blank rows.

The only other way is via code.
The following event code was written for a Table called Table2
Data is entered in columns A and B, and columns C and D contain formulae.
You would need to amend to suit your situation.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim tr As Long
tr = Target.Row
If Target.Count 1 Then Exit Sub
If tr = 1 Then Exit Sub
If Target.Column < 1 Then Exit Sub
ActiveSheet.Unprotect
ActiveSheet.ListObjects("Table2").Resize Range("$A$1:$D" & tr)
Range(Cells(tr + 1, "A"), Cells(tr + 1, "B")).Locked = False
ActiveSheet.Protect
End Sub

To install
Copy code as above
Right click on sheet tabView Code
Paste code into white pane that appears
Alt+F11 to return to Excel
--
Regards
Roger Govier

Hugh wrote:
In Excel 2007 I have a formatted table, 10 columns wide, in which 5 of the
columns have formulas.

There is a nice feature in Excel 2007 that allows me to type a value in a
cell which is directly beneath the table and the table then expands to
€œconsume€ that value and automatically fills the remaining columns in the
table with, where appropriate, the formulas.

I want to protect the table so that the formulas are not inadvertently
overwritten AND take advantage of this feature.

However, if I lock and hide the cells, then Protect the worksheet, this
feature is disabled.

Can anyone help?

.

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
Protecting Pivot Tables. GEM Excel Discussion (Misc queries) 2 August 6th 09 05:17 PM
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
Protecting my formulas marko Excel Discussion (Misc queries) 2 December 19th 05 06:43 PM
Protecting Formulas brose Excel Discussion (Misc queries) 6 April 29th 05 01:38 AM
Protecting Formulas Keith Camacho New Users to Excel 1 April 9th 05 04:37 PM


All times are GMT +1. The time now is 03:51 AM.

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"