Extract originating cell reference of consolidated worksheets

henryg

Board Regular
Joined
Oct 23, 2008
Messages
151
Office Version
  1. 365
Platform
  1. Windows
I have a PQ that consolidates various worksheets, and on that "Summary" added a column with the originating table names. All good so far other than PQ imports table names containing '-' with '_', hence the "Replaced Underscores" code.

I would also like the originating worksheet cell reference in a column but can't get it to work that even using AIs. The M code is below. Anything I can do?

let
Source = Excel.CurrentWorkbook(),
#"Filtered Rows" = Table.SelectRows(Source, each Text.StartsWith([Name], "hFirst") or Text.StartsWith([Name], "Joint")),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Name", Order.Ascending}}),
#"Expanded Content" = Table.ExpandTableColumn(#"Sorted Rows", "Content", {"Date", "Description", "Amount", "Notes"}, {"Date", "Description", "Amount", "Notes"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Content",{{"Date", type date}}),
#"Filtered Rows1" = Table.SelectRows(#"Changed Type", each true),
#"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each ([Date] <> null) and ([Description] <> "Opening balance")),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows2",{{"Name", "Table Name"}}),
#"Replaced Underscores" = Table.TransformColumns(#"Renamed Columns", {"Table Name", each Text.Replace(_, "_", "-"), type text})
in
#"Replaced Underscores"

Ideally I would like to have hypertext links to the originating data.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,992
Messages
6,175,829
Members
452,673
Latest member
LaMiaAvy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top