|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- let
- Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
- A = let a = Table.SelectColumns(Source,{"B芯片数量", "B芯片片数", "B芯片片号", "B芯片批号"}),
- b = Table.ColumnNames(a),
- c = Table.TransformColumns(a,{{"B芯片数量",each List.RemoveLastN(Text.Split(_,","),1)},{"B芯片片号",each Text.Split(_,",")},{"B芯片片数",each Text.Split(_,",")},{"B芯片批号",each Text.Split(_,",")}})
- in List.Transform(Table.ToRows(c),each
- let m = Table.Transpose(Table.FromRows(_)),
- n = Table.ColumnNames(m),
- o =List.Zip({n,b})
- in Table.RenameColumns(m,o)
- ),
- B = let a = Table.RemoveColumns(Source,{"B芯片数量", "B芯片片数", "B芯片片号", "B芯片批号"}),
- b = List.Combine({Table.ColumnNames(a),{"a"}}),
- c = List.Combine({Table.ToColumns(a),{A}})
- in Table.FromColumns(c,b),
- #"Expanded a" = Table.ExpandTableColumn(B, "a", {"B芯片数量", "B芯片片数", "B芯片片号", "B芯片批号"}, {"a.B芯片数量", "a.B芯片片数", "a.B芯片片号", "a.B芯片批号"})
- in
- #"Expanded a"
复制代码 |
|