|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- // output
- let
- Source = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
- splitCol = Table.SplitColumn(Source, "源", fnSplit, {"年", "月", "描述"})
- in
- splitCol
- // fnType
- let
- Source = (t)=>if t="年" or t="月" then Number.Type else Value.Type(Value.FromText(t))
- in
- Source
- // fnSplit
- (str)=>
- let
- tolist = Text.ToList(str&"'"),
- acc = List.Accumulate(
- tolist,
- {"", "", {}},
- (s,c)=>if c = "'" or (fnType(s{0})<>fnType(c))
- then {c, c, if fnType(s{0})=Text.Type then s{2}&{s{1}} else {s{1}}&s{2}}
- else {c, s{1}&(if s{0} = "年" then "-" else "") &c, s{2}}
- ){2},
- otlist = let lst=Text.Split(acc{0}, "-") in {lst{0}}&{lst{1}? ??"无"}&{acc{2}}
- in
- otlist
复制代码 可以试试我的这个
|
评分
-
2
查看全部评分
-
|