• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Loop through Filtered Data (visible rows), to derive calculated value from 2 columns.

The macro with .UsedRange.Name = "SceData" is the old macro and it does something different.
I attach file with my PromoteHeaders amendment to cater for older Power Query versions.


Thank you p45cal, it works good.

I haven't tried Power Query, so no idea how this would work. It is asking a bit more from you. If possible and time permits, could you mention in steps how did you do this?

Regards,
Don
 
Oh groan, I hate this.

There is a named range SceData on the Lines sheet which is updated/added by the first 3 lines of the blah macro.
The behaviour of Power Query varies depending on whether the selected cell/selection is in a named range or not when you start the following.
Select a cell in the table on the Lines sheet.
Go to the Data tab of the ribbon and click From Table/Range in the Get & Transform Data section of that tab:
71723

It should do 3 steps for you.
Then choose the Add Column tab and choose Custom Column:
71724

which will give this, which you have to fill in. Update the dialogue which pops up as follows:
71725
and click OK.

Select the Section column, go to the Transform tab, and click on Group By, follow the annotations:
71727

Then go to the Home tab, click the small Close & Load dropdown arrow and choose Close & Load to…
71728
continued in next message…
 
Last edited:
and choose say the following, selecting any cell where you want the table to appear:
71729

and that's it.

At the start, if there is no named range, Power Query asks you to confirm the range and that it has headers:
71730

it will create an Excel table and there is no Promoted Headers step in the query:
71731

otherwise there's no other difference.
 
Back
Top