Issues on Consolidating Several Sheets into One Sheet inside a Workbook

tksnota

New Member
Joined
Feb 11, 2024
Messages
28
Office Version
  1. 365
Hi,

I'm Noel and new in this forum.

This is my first post and will not be the last.

My question is why not all the tabs are being captured in power query when I run the Excel.CurrenWorkbook()?

I had 25 tabs in the worksheet and only showed 2 or these 2 are tables?

What do I need to do to use power query to consolidate the data from the 25 tabs without creating new 25 queries and not using the consolidate function?


1707697412087.png
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Excel.CurrentWorkbook() is going to retrieve the tables and named ranges in the current workbook.

If you want all the data in a saved workbook you can use Excel.Workbook(File.Contents("file path and name here"), null, true).

Alternatively you can name the used range in each sheet and then use the Excel.CurrentWorkbook() function.

Here is a macro that will name the used range of each sheet:

VBA Code:
Sub NameSheetData()
    Dim s, rt As String
    For Each s In Worksheets
        rt = "=" & s.Name & "!" & s.UsedRange.Address
        ActiveWorkbook.Names.Add Name:=s.Name & "Content", RefersTo:=rt
    Next
End Sub
 
Upvote 0
thanks. is the one i need to use Excel.Workbook(File.Contents("file path and name here"), null, true) for power query?

i'm really sorry because i'm new to this power query so i have some follow up questions

- is File.Contents a command or the filename itself
- file path meant where it stored. if so can i use the path for shared online drive e.g. one drive and will i be able to autorefresh it?
- is name here the actual file name?
- i need to show some null cells. what do i need to replace the null? or can i just automatically consolidate the data in one sheet with both null and duplicate data?

thanks
 
Upvote 0

Forum statistics

Threads
1,215,177
Messages
6,123,475
Members
449,100
Latest member
sktz

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