View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
GovUser
 
Posts: n/a
Default How to sort but keep linked formulas?

Thank you for your reply. I tried the formula. Unfortunately I got the same
result - my linked subset continued to reference the original CELL locations,
but the data in those original cells has now changed due to the sort.

I believe the linked cell references are not updating because I am Sorting
the original source data as opposed to moving cells by Cutting or Inserting
/Deleting. Hence that may be why the INDIRECT function didn't work???

"Hans Knudsen" wrote:

If you have your data in A1:B5 and your linked data for example in A12:B14 then do as follows:

Enter in A12: =INDIRECT("A"&ROW(A5))
Enter in B12: =INDIRECT("B"&ROW(A5))

Similarly for RST and GHI.
Now you can sort A1:B5.

Hans






"GovUser" skrev i en meddelelse ...
I have a complete set of UNsorted, source data. I have created a SUBSET of
this data by LINKING and copying the desired ROWS.

My question: When I SORT the source set/rows of complete data (by name in
column A), the links in the subset remain linked to the CELL references in
column A, not the data. Therefore, the original copied data gets replaced
with the new sorted data. I have tried the links with and without absolute
cell references. I do not want to use "Paste Values" because the source data
may change and I want the copied subset to update automatically.

Is there a way to keep the LINKS to the original client rows of data in my
subset, while also being able to SORT the Source data?

***********
EXAMPLE
***********
Complete Source (Before sort)
--------
1 XYZ xxx
2 GHI xxx
3 LMN xxx
4 ABC xxx
5 RST xxx

Linked subset data (Before sort)
--------
1 RST xxx (cell formulas: =A5 or =$A5)
2 ABC xxx (cell formulas: =A4 or =$A$4)
3 GHI xxx (cell formulas: =A2 or =$A$2)


***********
***********
Complete Source (After sort)
--------
1 ABC xxx (previously 4)
2 GHI xxx (previously 2)
3 LMN xxx (previously 3)
4 RST xxx (previously 5)
5 XYZ xxx (previously 1)

Linked subset data (After sort)
--------
1 XYZ xxx (new =A5, wanted "RST" (original #5))
2 RST xxx (new =A4, wanted "ABC" (original #4))
3 GHI xxx (new =A2, wanted "GHI" (original #2))