How do I make power query look at a new table every time a new sheet Is added

SPS41

New Member
Joined
Feb 21, 2023
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi, I am new to power query and I have a hopefully easy question.

I have a template which has a table and I have made power query look at it and make changes, thus creating a new sheet with those changes.

Now if I want to add a new sheet which has a table in it just like the template but with a different sheet name, is there a way to make power query also look at the new sheet. Is there some vba code I can use or is there a way to make power query automatically do this?
Any help would be appreciated and thanks in advance!
 
You should be able to expand after using this

Power Query:
let
    Source = Excel.CurrentWorkbook(),
    last = Table.LastN(Source, 1)
in
    last
 
Upvote 1
Solution

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You should be able to expand after using this

Power Query:
let
    Source = Excel.CurrentWorkbook(),
    last = Table.LastN(Source, 1)
in
    last
You should be able to expand after using this

I will try this out but I also found out that List.LastN is another way of tackling it. I don’t know how both work but I will try both and keep you updated.
 
Upvote 0
Tweaked it a little and it worked for me. Appreciate it and thanks for all the help!
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,636
Members
452,662
Latest member
Aman1997

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