Creating 'duplicate' cells in other Excel (2010) Sheets including formatting - excel

Just hoping someone can help - I've been experimenting and googling for ages with no success!
On Excel 2010, I would like to copy a range of cells from one sheet (say, Sheet 1) to another in the same workbook. I need the copy to have the contents of the cells AND their formatting AND to mirror any changes which happen to either the contents or formatting of those cells in Sheet 1.
Is there any way I can do this please? Please note, I'm not familiar with using VBA so if that's needed I'll need some instructions about how to use/copy any code solutions you give me into my workbook too?

if you select both sheets (press CTRL while selecting sheet tabs) everything you do on sheet1 is replicated on sheet2
so select both sheets
select a cell or range of cells
format and enter content as desired
untie sheets (press CTRL while selecting sheet tabs)
sheet2 is a duplicate of sheet 1
hope that helps

To duplicate cells on Sheet 1 on Sheet 2, even when entering new rows on sheet 1
Enter ROW() in every row of column "A" in sheet one. This duplicates the row number to be used for your vlookup.
On Sheet 2 for every cell you wish to duplicate:
=IFERROR(VLOOKUP(ROW(),'Sheet 1'!$A:$G,COLUMN()+1,FALSE),"")
When entering a new row on Sheet 1, you will need to copy the ROW() function to the first column of the new row.
All other adjustments are automatic except adding columns. Adding columns requires additional steps.

Related

Prevent #ref when cell deleted

I'm importing a text file into one sheet, eliminating un-needed lines, while formatting the data on the second sheet.
I have all the formulas on the second sheet set up, referencing cells on the first sheet.
The problem is that after deleting the un-needed lines and the data moves up, the formulas for the deleted lines say #ref. I want the formulas to use, say Sheet1!B2 no matter what data is there.
I see that Indirect works, so the next question is, how can I copy the Indirect function down a colum of 500 rows with each one having the right reference?
Thanks
I had this same problem recently so just passing along the answer I got. Index functions will help. Below you can see one where the sheet name is reference in cell a1 and it will return the value in cell a2 of the corresponding sheet.
=INDEX(INDIRECT($A1&"!2:2"),COLUMN(A:A))
If you only need to reference cells on the same row, including cells on different sheets on the same row, there's an easier way than Indirect.
If you write in A42:
=#B:B
it will look up B42.
If you write in A42:
='Sheet 2'!#X:X
It will look up X42 on Sheet 2.
If you delete the top rows on Sheet 2, the formula on Sheet 1 will point to the new X42 - no #REF! errors.
As long as your formulas in Sheet 1 just need to reference cells on the same row in Sheet 2 - so the formula in 'Sheet 1'!A42 might want 'Sheet 2'!X42 but not 'Sheet 2'!X43 - you can just put the column names as inputs into the formula. Otherwise you'll need Indirect.
For bonus points, name the columns in Sheet 2, so instead of ='Sheet 2'!#X:X you could write =cust_DateOfBirth for example.

Excel Cell = Cell

I have set up 4 sheets within a workbook.
The first sheet has every Colum in it and the other three are segments of the first.
If I'm on sheet two I can add "=Sheet1!A2" and it will copy the value of that cell. However, is there a way that I can configure so that if I want to change a value on Sheet 2 Cell A2 I can do that on Sheet 2 and then it update Sheet1.
I don't know how to even attempt searching this on google, so I have turned to yourselves for help.
Thanks,

Can I use one formula for several sheets?

I have a workbook that currently have 20 sheets and it grows with about 3 sheets per day.
All sheets use the same formulas in columns H-L.
But sometimes I find errors in the formulas or need to ad a condition to it and then I need to update all sheets formulas with the same formula. And that is the problem.
Can I have the formula in one cell somewhere and in each column just reference to this formula so that if I change the formula in this cell it will change in all places?
In each sheet I need the formula to "fill down" about 2300 rows.
In sheet1
A1
=A1+B1
In sheet2
A1
='sheet1'!A1 // will calculate A1+B1
Anyone know of a way to do this?
If all sheets have the same structure, you can use a 3D selection to change a formula in the same cell on all sheets.
For example, if your workbook has sheets 1 to 10, select cell B1 in Sheet1, then hold down the Shift key and click Sheet10. Now all cells B1 in all sheets from Sheet1 to Sheet10 are selected, no matter what the sheet name is.
Enter a formula like =A1+A2 and hit Enter. Click any sheet and check the result. B1 will have that formula in each of the sheets.
Now go back to Sheet1, select B1, hold Shift and click Sheet10. Change the formula to =A1*A2 (multiply instead of add) and hit Enter. Copy the formula down.
Check the other sheets and see that the same formula has been applied and copied down on all other sheets.
With this technique, you can select the same cell in all sheets of the workbook and change the formula in all sheets with just one edit. Of course, it only works if all sheets in the selection have the same data structure.
Edit after comment: You could use the first sheet as the Formula Master sheet, and just need to remember that if you want to change a formula, you first have to use a 3D selection. Other than that, Excel does not offer formula replication in the way you describe. A reference to a cell will always return the cell's value, not its formula.
You could create a UDF (user defined function) in VBA for your goal:
Press Alt+F11, right click on your project in the project explorer and select Insert --> Module. Paste the code below:
Function ExecuteFormula(ByVal Target As Range)
On Error Resume Next
ExecuteFormula = Evaluate(Target.Formula)
End Function
Now you can use the ExecuteFormula() like every other function. If you want to enter the formula in your master sheet as a string "=A1+B1" just replace the 3rd line with:
ExecuteFormula = Evaluate(Target.Value)
I hope this helps.

Excel 2007 - Compare two sheets and paste the variance in new sheet

I have two sheets named sheet1 and sheet2 ; Both have same number of columns which started from A to AI . I need to compare both the sheets if in-case it finds variance in anyone of the individual cell on that time it must to copy the entire row and paste it into new sheet named Sheet3. Kindly reply me as soon as possible.
Many thanks in advance.
Here is a quick pseudocode sample of how I would go about it:
for each row in worksheet
for each cell in the row
if cell on sheet1 <> cell on sheet2
copy row to sheet3
end if
next
next
A couple of options
You can download a 30 free trial version of SpreadSheet Advantage which has a
1) column and row alignment function that can be run to set the 2 sheets up in a like for like fashion (to adjust for a deleted or additional row as per Tom's point above).
2) A very quick sheet v sheet compare output that works on formulae, values or both, highlighting only the parts of the cells that are different
or
If the sheets are already perfectly aligned
you could use this free compare.xla addin by Myrna Lawson and Bill Manville
if you wanted a value comparison only then you could set up a simple formula in A1 of a third sheet to compare the values of A1 in sheets 1 and 2 etc

How to automate a spreadsheet

I am using microsoft excel 2002. What I am wanting to do is say I have some data in column A in sheet 1 and data in column A in sheet 2.
What I want to do is when I add data to sheet 1 Column A (lets say some text), I want excel to automatically add a row in sheet 2 column A. So if I have 30 rows in both sheets and I add a string "hello" in sheet 1 Column A (in row 31), I want it to automatically add the same row in sheet 2 Column A (row 31).
Is this possible to do from within excel?
Thanks in advance for your help.
In column Sheet 2 , column A row 1
enter the formula '='Sheet 1'!A1
Then cntrl C the cell with the formula you just entered,
Still in Sheet 2 select cells A2 to A99 or however many columns you expect to enter
cntrl V
The values you enter in Sheet1 will magically appear in sheet2
You can do this easy in VBA. If getting started is hard for you, record a macro and check out the generated code. You'll have no problem continuing from there.
Good luck!
you could put an Array formula in Sheet2 Column A. I dont think you can get this to work on the entire column, but you could apply it to say the first 5000 rows. Then when the user enters values on Sheet1 they would be duplicated on Sheet2.
Somthing like:
=IF(Sheet1!$A$1:$A$5000="","",Sheet1!$A$1:$A$5000)
Should copy the cells from A1:A5000 and remove the empty ones into the destination range. You will need to select the 5000 cells on Sheet2 and enter the formula and then press Ctrl-Enter to insert it as an array formula.
This is far simpler than attempting to build something either with VBA or VSTO to watch for changes and duplicate them.

Resources