SOLVED
Home

Protection of Formulas in 2 Sheet Workbook

%3CLINGO-SUB%20id%3D%22lingo-sub-957352%22%20slang%3D%22en-US%22%3EProtection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957352%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20two%20sheet%20workbook.%26nbsp%3B%20Sheet%201%20has%20unprotected%20areas%20for%20payroll%20data%20entry%2C%20one%20row%20for%20each%20employee.%26nbsp%3B%20Sheet%202%20is%20completely%20protected%20and%20pulls%20data%20from%20specific%20cells%20in%20sheet%201%20and%20manipulates%20the%20data%20to%20create%20data%20for%20payroll%20checks%20in%20a%20required%20grouping%20of%20several%20rows%20on%20sheet%202%2C%20for%20each%20row%20on%20sheet%201.%3C%2FP%3E%3CP%3EThe%20problem%20I%20have%20is%20that%20if%20somebody%20wants%20to%20take%20the%20data%20on%20a%20row%20in%20sheet%201%2C%20and%20cut%20and%20paste%20it%20to%20a%20different%20row%20on%20sheet%201%2C%20the%20links%20to%20specific%20cells%20on%20sheet%202%20will%20follow%20the%20data%2C%20causing%20errors%20on%20sheet%202.%26nbsp%3B%20To%20further%20explain%3A%3C%2FP%3E%3COL%3E%3CLI%3EAssume%20payroll%20data%20is%20loaded%20in%20the%20first%206%20rows%20of%20sheet%201%2C%20to%20create%206%20paychecks.%20Each%20row%20is%20to%20create%20a%20payroll%20check%2C%20and%20the%20data%20from%20each%20row%20in%20sheet%201%20is%20spread%20among%2010%20rows%20on%20sheet%202.%3C%2FLI%3E%3CLI%3EThe%20person%20entering%20the%20data%20finds%20that%20row%203%20on%20sheet%201%20should%20not%20have%20been%20entered%2C%20and%20deletes%20the%20info%20.%26nbsp%3B%20He%20then%20wants%20to%20move%20rows%204%20to%206%20up%20o%20rows%203%20to%205%2C%20and%20does%20cut%20and%20paste.%3C%2FLI%3E%3CLI%3EOn%20sheet%202%2C%20because%20the%20data%20moved%20on%20sheet%201%20was%20linked%20to%20specific%20cells%20on%20sheet%202%2C%20the%20cells%20on%20sheet%202%2C%20related%20to%20rows%203%20to%206%20on%20sheet%201%2C%26nbsp%3B%20now%20all%20reflect%20error%20message%20on%20sheet%202.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EIs%20there%20a%20way%20that%20the%20Sheet%202%20formulas%20can%20be%20locked%2C%20so%20that%20links%20from%20sheet%202%20to%20specific%20cells%20on%20sheet%201%20do%20not%20move%20and%20create%20errors%20when%20data%20is%20moved%20on%20sheet%201%3F%26nbsp%3B%20See%20attached%20workb%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-957352%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957523%22%20slang%3D%22en-US%22%3ERe%3A%20Protection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957523%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F433310%22%20target%3D%22_blank%22%3E%40tfalik%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20was%20no%20workbook%20attached%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGenerally%20cutting%20and%20pasting%20should%20be%20avoided%20when%20you%20have%20formulas%20linking%20to%20cells%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20possible%20option%20would%20be%20to%20reference%20the%20cells%20using%20INDEX%20and%20a%20number%20rather%20than%20a%20direct%20link%20to%20a%20cell%2C%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ee.g.%20INDEX(A1%3AA10%2C%202)%26nbsp%3B%20would%20always%20reference%20A2%20regardless%20of%20cut%20and%20paste%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957613%22%20slang%3D%22en-US%22%3ERe%3A%20Protection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957613%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F433310%22%20target%3D%22_blank%22%3E%40tfalik%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20sounds%20similar%20to%20a%20workbook%20I%20have%20created%20to%20track%20stock%20and%20options%20positions.%20It%20is%20based%20on%20a%20separate%20worksheet%20that%20is%20downloaded%20daily%20from%20the%20brokerage%2C%20where%20the%20sequence%20of%20rows%20can%20change%20based%20on%20transactions%20since%20the%20last%20download.%20What%20I%20do%20is%20reference%20the%20newly%20updated%2Fdownloaded%20worksheet's%20cells%20anew%20each%20time%20in%20the%20workbook%20that%20actually%20processes%20the%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EData%20integrity%20is%20maintained%20by%20keeping%20to%20a%20single%20row%20for%20any%20stock%2Foption%20(in%20your%20case%20it%20would%20be%20any%20single%20employee)....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%20as%20Wyn%20Hopkins%20as%20already%20suggested%2C%20if%20you%20could%20actually%20attach%20a%20sample%20of%20what%20you're%20working%20with%2C%20we%20might%20be%20able%20to%20make%20more%20informed%20recommendations.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957676%22%20slang%3D%22en-US%22%3ERe%3A%20Protection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957676%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9832%22%20target%3D%22_blank%22%3E%40Wyn%20Hopkins%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EWyn%3A%3C%2FP%3E%3CP%3EI%20tried%20to%20load%20my%20spreadsheet%2C%20but%20apparently%20that%20did%20not%20work.%26nbsp%3B%20Perhaps%20it%20was%20too%20large.%20It%20sounds%20like%20the%20Index%20function%20is%20exactly%20what%20I%20need.%26nbsp%3B%20I%20will%20try%20that%20out.%26nbsp%3B%20Thanks.%3C%2FP%3E%3CP%3ETom%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-957477%22%20slang%3D%22en-US%22%3ERe%3A%20Protection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-957477%22%20slang%3D%22en-US%22%3EDon't%20see%20your%20workbook.%20Please%20try%20to%20attach%20it%20again.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-963908%22%20slang%3D%22en-US%22%3ERe%3A%20Protection%20of%20Formulas%20in%202%20Sheet%20Workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-963908%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9832%22%20target%3D%22_blank%22%3E%40Wyn%20Hopkins%3C%2FA%3E%26nbsp%3BI%20used%20the%20Array%20Form%20of%20the%20Index%20function%2C%20and%20it%20worked%20perfectly.%26nbsp%3B%20I%20set%20up%20a%20separate%20array%20for%20each%20column%20of%20my%20source%20data%2C%20and%20then%20copied%20the%20index%20function%20into%20each%20formula%20in%20each%20group%26nbsp%3B%20on%20my%20target%20sheet.%26nbsp%3B%20I%20then%20went%20through%20each%20index%20function%20on%20the%20target%20sheet%2C%20and%20only%20had%20to%20revise%20the%20source%20row%20number%20to%20reach%20the%20intended%20data.%26nbsp%3B%20Thanks%20Wyn%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
tfalik
New Contributor

I have a two sheet workbook.  Sheet 1 has unprotected areas for payroll data entry, one row for each employee.  Sheet 2 is completely protected and pulls data from specific cells in sheet 1 and manipulates the data to create data for payroll checks in a required grouping of several rows on sheet 2, for each row on sheet 1.

The problem I have is that if somebody wants to take the data on a row in sheet 1, and cut and paste it to a different row on sheet 1, the links to specific cells on sheet 2 will follow the data, causing errors on sheet 2.  To further explain:

  1. Assume payroll data is loaded in the first 6 rows of sheet 1, to create 6 paychecks. Each row is to create a payroll check, and the data from each row in sheet 1 is spread among 10 rows on sheet 2.
  2. The person entering the data finds that row 3 on sheet 1 should not have been entered, and deletes the info .  He then wants to move rows 4 to 6 up o rows 3 to 5, and does cut and paste.
  3. On sheet 2, because the data moved on sheet 1 was linked to specific cells on sheet 2, the cells on sheet 2, related to rows 3 to 6 on sheet 1,  now all reflect error message on sheet 2.

Is there a way that the Sheet 2 formulas can be locked, so that links from sheet 2 to specific cells on sheet 1 do not move and create errors when data is moved on sheet 1?  See attached workb

5 Replies
Highlighted
Don't see your workbook. Please try to attach it again.
Highlighted
Solution

@tfalik 

 

There was no workbook attached

 

Generally cutting and pasting should be avoided when you have formulas linking to cells

 

One possible option would be to reference the cells using INDEX and a number rather than a direct link to a cell,  

 

e.g. INDEX(A1:A10, 2)  would always reference A2 regardless of cut and paste

 

 

 

 

Highlighted

@tfalik 

 

This sounds similar to a workbook I have created to track stock and options positions. It is based on a separate worksheet that is downloaded daily from the brokerage, where the sequence of rows can change based on transactions since the last download. What I do is reference the newly updated/downloaded worksheet's cells anew each time in the workbook that actually processes the data.

 

Data integrity is maintained by keeping to a single row for any stock/option (in your case it would be any single employee)....

 

Anyway, as Wyn Hopkins as already suggested, if you could actually attach a sample of what you're working with, we might be able to make more informed recommendations.

Highlighted

@Wyn Hopkins  

Wyn:

I tried to load my spreadsheet, but apparently that did not work.  Perhaps it was too large. It sounds like the Index function is exactly what I need.  I will try that out.  Thanks.

Tom

Highlighted

@Wyn Hopkins I used the Array Form of the Index function, and it worked perfectly.  I set up a separate array for each column of my source data, and then copied the index function into each formula in each group  on my target sheet.  I then went through each index function on the target sheet, and only had to revise the source row number to reach the intended data.  Thanks Wyn

Related Conversations