Excel中如何将表格内容变换成一行数据?

如何将图一变成图二(软件用的是WPSoffice)
2024-12-04 04:13:53
推荐回答(1个)
回答(1):

'自定义公式-按ALT+11-插入-模块(2行查询合并)
Function hebing(a As Range, b As Range, Optional ByVal numformat As String = ",")
Calculate '重算表格
Dim t As String
For i = 1 To a.Columns.Count
If b.Cells(1, i) <> "" Then t = t & numformat & a.Cells(1, i) & "*" & b.Cells(1, i)
If a.Cells(1, i) = "" Then Exit For
Next
hebing = Right(t, Len(t) - 1)

Calculate
End Function