let from = Excel.CurrentWorkbook(){[Name="Таблица1"]}[Content], nms = List.Range(Table.ColumnNames(from),2), lst = List.Transform({1..Number.IntegerDivide(List.Count(nms),7)},(x)=>{"П"&Text.PadStart(Text.From(x),2,"0")}), cmb = Table.CombineColumns(from,nms,(x)=>List.Transform(List.Zip({lst,List.Split(x,7)}),List.Combine),"tmp"), exp = Table.ExpandListColumn(cmb, "tmp"), to = Table.SplitColumn(exp,"tmp",(x)=>x,8) in to
[/vba]
[vba]
Код
let from = Excel.CurrentWorkbook(){[Name="Таблица1"]}[Content], nms = List.Range(Table.ColumnNames(from),2), lst = List.Transform({1..Number.IntegerDivide(List.Count(nms),7)},(x)=>{"П"&Text.PadStart(Text.From(x),2,"0")}), cmb = Table.CombineColumns(from,nms,(x)=>List.Transform(List.Zip({lst,List.Split(x,7)}),List.Combine),"tmp"), exp = Table.ExpandListColumn(cmb, "tmp"), to = Table.SplitColumn(exp,"tmp",(x)=>x,8) in to