时间:2022-02-23 09:37:26
建一个模块,写入下面代码
Function LianJie(Rg As Range, sr As String)
Dim R As String
Application.Volatile True
For Each s In Rg
If s <> "" Then
R = R & sr & s
End If
Next s
LianJie = Right(R, Len(R) - 1)
End Function
使用:=LianJie(D2:J2,",")

Excel中自定义连接函数的代码实现
博客介绍了在Excel中自定义连接函数的方法。通过建立模块,写入特定的VBA代码定义了一个名为LianJie的函数,该函数可将指定区域内非空单元格用指定字符串连接起来,还给出了函数的使用示例。
4277

被折叠的 条评论
为什么被折叠?



