A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I link cells, sheet to sheet, to recognize row deletions?



 
 
Thread Tools Display Modes
  #21  
Old November 21st, 2005, 02:40 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

In Sheet2

What's the purpose of the Row 1 formula


The formula in A1 is actually not required (I forgot to delete it)
as the col headers in A1:C1 could just be pasted over from Sheet1

Whereas the formula for row 2 is more complicated:
=IF(OFFSET(INDIRECT("Sheet1!A1"),ROWS($A$1:A2)-1,)=0,"",
OFFSET(INDIRECT("Sheet1!A1"),ROWS($A$1:A2)-1,))


The above isn't really that complicated g. It just includes an IF
condition to return blanks: "" should the result evaluated by the OFFSET
formula be equal to zero, i.e. basically: =IF(OFFSET(...)=0,"",OFFSET(...))
The inclusion of the IF here is just one way to produce a cleaner look in
Sheet2

...and what if I need three or four
additional header rows instead of just one row...
do I just change the "A2"s throughout, to "A5" or "A6", etc?


No, simply put the same formula above (in A2) in the new starting cell, then
copy down from there. The formula* will auto-increment correctly when you
copy down from the starting cell.

For example, if we wanted to link to Sheet1's A2:A10 in say, Sheet2's
A10:A19, i.e. start the link in Sheet2's A10 (instead of A2), then we would
put the same formula into Sheet2's A10:
=IF(OFFSET(INDIRECT("Sheet1!A1"),ROWS($A$1:A2)-1,)=0,"",OFFSET(INDIRECT("She
et1!A1"),ROWS($A$1:A2)-1,))
and then copy A10 down to A19

*this part in the formula will auto-increment: ROWS($A$1:A2)
when copied down to become: ROWS($A$1:A3), ROWS($A$1:A4), etc

Trust the above clarifies it a little better ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #22  
Old November 21st, 2005, 02:54 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

Sorry, "A19" should read as "A18" in the lines
... link to Sheet1's A2:A10 in say, Sheet2's A10:A19
... and then copy A10 down to A19

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #23  
Old February 16th, 2006, 02:28 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

Max, the formula you gave, to "copy down", works great except that when I add
or delete a row to worksheet 1, column A, it only adds or deletes one CELL in
the Column A's of all the other worksheets...resulting in data misalignment
with the rest of the columns on those sheets. How can I make the row change
in worksheet 1, column A, replicate as a row change in all the other
worksheets? (Note: Worksheet 1's columns b through ?? have different data
layout content and requirements than columns b through ?? on the other
worksheets.) I also forwarded this to you via email with examples.

"Max" wrote:

Sorry, "A19" should read as "A18" in the lines
... link to Sheet1's A2:A10 in say, Sheet2's A10:A19
... and then copy A10 down to A19

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--



  #24  
Old February 17th, 2006, 02:40 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

.. How can I make the row change
in worksheet 1, column A,
replicate as a (corresponding)
row change in all the other worksheets?


Formulas cannot achieve the essence above, Bob.
We would need a subroutine (vba) to do that.
(I did a brief trawl through google's archives
but was unable to find something suitable to suggest)

Hang around awhile for possible responses from others versed in vba who
might have something to offer you.
(I've cross posted this response to .programming)

Good luck !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"BobW" wrote in message
...
Max, the formula you gave, to "copy down", works great
except that when I add or delete a row to worksheet 1,
column A, it only adds or deletes one CELL in
the Column A's of all the other worksheets...
resulting in data misalignment
with the rest of the columns on those sheets.
How can I make the row change
in worksheet 1, column A, replicate as a row change
in all the other worksheets? (Note: Worksheet 1's
columns b through ?? have different data
layout content and requirements than columns b
through ?? on the other worksheets.)
I also forwarded this to you via email with examples.



  #25  
Old February 17th, 2006, 05:07 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

Bob,

In the interim, perhaps you would like to try the 2 "bare-bones" subs below
on a **spare** copy of your book (First, kill all previous formulas in col A
in all "slave" sheets with an in-place: Copy Paste special check
"Values" OK)

Press Alt+F11 to go to VBE
Click Insert Module
Copy and paste the 2 subs below into the code window
Press Alt+Q to exit VBE and go back to Excel

In Excel,
in your master sheet: ToolEvaluation

Click View Toolbars Forms
Click on the button icon and draw a button somewhere on the sheet

The Assign Macro dialog will pop up
Look for "InsertRow" in the dialog box, select it OK
(or just double-click on "InsertRow")
The above assigns the Sub InsertRow() to this button.
Right-click on the button Edit Text [to rename the button]

Repeat to draw another button, assign "DeleteRow"
Right-click the button to select, re-position the 2 buttons
somewhere near the top, say, within A2

Test it out ..

In ToolEvaluation,
Say, we want to insert a new row 7
Select say, A7, then click the button "InsertRow"
This will insert a new row 7 in "ToolEvaluation", and correspondingly insert
a new row 7 as well in the slave sheets: "Documentum" & "Hummingbird"

Re-select the "new" A7, click DeleteRow
This will delete the entire row 7 in "ToolEvaluation", and correspondingly
deletes row 7 in sheets: "Documentum" & "Hummingbird" as well

'--------
Sub InsertRow()
'ToolEvaluation is the master sheet
Sheets(Array("ToolEvaluation", "Documentum", "Hummingbird")).Select
Sheets("ToolEvaluation").Activate
ActiveCell.EntireRow.Insert
Sheets("ToolEvaluation").Select
End Sub

Sub DeleteRow()
'ToolEvaluation is the master sheet
Sheets(Array("ToolEvaluation", "Documentum", "Hummingbird")).Select
Sheets("ToolEvaluation").Activate
ActiveCell.EntireRow.Delete
Sheets("ToolEvaluation").Select
End Sub
'------
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #26  
Old February 17th, 2006, 11:51 PM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

Max, you genius, i owe you a virtual beer!!!
By the way, just for fun I tried it without first killing all the previous
formulas in the slave sheets....guess what? It wasn't necessary; when I add
a new row using your buttion, it's reflected on all slave sheets AND the new
row on the slave sheet inherits the 'copied down' formula automatically so
not only does the new row go in fine, but its new name replicates through all
the slave sheets, too. Just what I wanted!

Incidentally, the actual workbook has about 22 slave sheets, so I had to add
all their names into your array string function.

This is just wonderful; thank you for the lesson. You are a good teacher!

"Max" wrote:

Bob,

In the interim, perhaps you would like to try the 2 "bare-bones" subs below
on a **spare** copy of your book (First, kill all previous formulas in col A
in all "slave" sheets with an in-place: Copy Paste special check
"Values" OK)

Press Alt+F11 to go to VBE
Click Insert Module
Copy and paste the 2 subs below into the code window
Press Alt+Q to exit VBE and go back to Excel

In Excel,
in your master sheet: ToolEvaluation

Click View Toolbars Forms
Click on the button icon and draw a button somewhere on the sheet

The Assign Macro dialog will pop up
Look for "InsertRow" in the dialog box, select it OK
(or just double-click on "InsertRow")
The above assigns the Sub InsertRow() to this button.
Right-click on the button Edit Text [to rename the button]

Repeat to draw another button, assign "DeleteRow"
Right-click the button to select, re-position the 2 buttons
somewhere near the top, say, within A2

Test it out ..

In ToolEvaluation,
Say, we want to insert a new row 7
Select say, A7, then click the button "InsertRow"
This will insert a new row 7 in "ToolEvaluation", and correspondingly insert
a new row 7 as well in the slave sheets: "Documentum" & "Hummingbird"

Re-select the "new" A7, click DeleteRow
This will delete the entire row 7 in "ToolEvaluation", and correspondingly
deletes row 7 in sheets: "Documentum" & "Hummingbird" as well

'--------
Sub InsertRow()
'ToolEvaluation is the master sheet
Sheets(Array("ToolEvaluation", "Documentum", "Hummingbird")).Select
Sheets("ToolEvaluation").Activate
ActiveCell.EntireRow.Insert
Sheets("ToolEvaluation").Select
End Sub

Sub DeleteRow()
'ToolEvaluation is the master sheet
Sheets(Array("ToolEvaluation", "Documentum", "Hummingbird")).Select
Sheets("ToolEvaluation").Activate
ActiveCell.EntireRow.Delete
Sheets("ToolEvaluation").Select
End Sub
'------
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #27  
Old February 18th, 2006, 12:26 AM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion

Glad it worked out well for you, Bob
and we had fun, too, along the way ! g
Thanks for the feedback ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"BobW" wrote in message
...
Max, you genius, i owe you a virtual beer!!!
By the way, just for fun I tried it without first killing all the previous
formulas in the slave sheets....guess what? It wasn't necessary; when I

add
a new row using your buttion, it's reflected on all slave sheets AND the

new
row on the slave sheet inherits the 'copied down' formula automatically so
not only does the new row go in fine, but its new name replicates through

all
the slave sheets, too. Just what I wanted!

Incidentally, the actual workbook has about 22 slave sheets, so I had to

add
all their names into your array string function.

This is just wonderful; thank you for the lesson. You are a good teacher!



  #28  
Old February 27th, 2006, 10:10 PM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion?

Max, I wonder if you can suggest how I can link column 1, sheet A in workbook
A, to all the Sheet A's in workbooks 2-25, so that if I change any column A
cell in Workbook 1, and then open any of the other workbooks, each of their
Sheet A cell contents will be updated to echo the change, AND also so that if
rows are inserted in Workbook A sheet A, those rows will also become inserted
in all the Sheet A's in the other workbooks...upon opening them...

I've tried Insert Link, and it works for the cell contents, but it doesn't
seem to work for automatically picking up added rows.

"Max" wrote:

Glad it worked out well for you, Bob
and we had fun, too, along the way ! g
Thanks for the feedback ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"BobW" wrote in message
...
Max, you genius, i owe you a virtual beer!!!
By the way, just for fun I tried it without first killing all the previous
formulas in the slave sheets....guess what? It wasn't necessary; when I

add
a new row using your buttion, it's reflected on all slave sheets AND the

new
row on the slave sheet inherits the 'copied down' formula automatically so
not only does the new row go in fine, but its new name replicates through

all
the slave sheets, too. Just what I wanted!

Incidentally, the actual workbook has about 22 slave sheets, so I had to

add
all their names into your array string function.

This is just wonderful; thank you for the lesson. You are a good teacher!




  #29  
Old February 27th, 2006, 10:27 PM posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: n/a
Default How do I link cells, sheet to sheet, to recognize row deletion?

"BobW" wrote:
.. also so that if rows are inserted in Workbook A sheet A,
... those rows will also become inserted in all the Sheet A's
in the other workbooks...upon opening them...


Afraid I'm out of my depth on this. Perhaps others better versed in vba
would step in here to offer you something. Hang around awhile.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #30  
Old November 6th, 2009, 10:23 PM posted to microsoft.public.excel.misc
purplec0ws
external usenet poster
 
Posts: 7
Default How do I link cells, sheet to sheet, to recognize row deletion

Is it possible to do modify this for multiple columns at a time or would I
have to do this for each column? So, I want to be able to do the same thing,
but for a whole range instead of just one column.

"Max" wrote:

One way to try ..

Assume the source col to be linked is col A in Sheet1, A1 down

In Sheet2
-------------
Put in any starting cell, say A1:
=OFFSET(INDIRECT("Sheet1!A1"),ROWS($A$1:A1)-1,)

Copy A1 down as many rows
as the linking is required to col A in Sheet1

This should now "recognize" any subsequent row* insertions / deletions in
Sheet1 (*or even column deletions in Sheet1)
viz. col A in Sheet2 will always point to what's in col A in Sheet1

Adapt to suit. For e.g. if you want to link to col B in Sheet3 instead,
change:

INDIRECT("Sheet1!A1")
to
INDIRECT("Sheet3!B1")

in the formula
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik atyahoodotcom
----
"LeeC" wrote in message
...
In Office XP - Excel - I want to copy a column from one sheet to another
sheet in the same workbook. I want the copied links to recognize row
deletions and insertions when I change the source sheet. When I use the
Copy, Paste Special, Paste Links command, the linked sheet does not

recognize
a row deletion in the source sheet. Instead, the linked sheet displays a

#Ref
message in the cell related to the deleted row.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I link cells, sheet to sheet, to recognize row deletions? LeeC New Users 2 May 24th, 2005 02:11 AM
How to create a link table at runtime to a sheet in an Excel workbook PAUL RIDINGS General Discussion 1 November 11th, 2004 11:20 AM
Printing non-adjacent cells on a single sheet Steve Walker New Users 2 August 11th, 2004 01:06 PM


All times are GMT +1. The time now is 11:33 PM.


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