How do I sort a table in Excel if it has cell references in it?

后端 未结 22 2017
逝去的感伤
逝去的感伤 2020-12-05 02:42

I have a table of data in excel in sheet 1 which references various different cells in many other sheets. When I try to sort or filter the sheet, the references change when

22条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 03:20

    You have a couple options:

    (1) There's no way around cell references getting messed up when sorting when not using static references. The most basic way to deal with this is to simply copy and paste as values before sorting, which could be automated via a simple VBA macro.

    (2) You could also try utilizing named ranges if you're using a number of common ranges across your formulas. You could define 'Sheet2!B23:28' as 'Range1' and reference 'Range1' within your formulas. In that case, sorting obviously wouldn't affect the range being specified since it's defined elsewhere.

    HTH

提交回复
热议问题