|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
G2单元格
=CUSTOM_TEXTJOIN_FILTER(",",$B$1:$B$22,$A$1:$A$22,E2,$C$1:$C$22,"正常")
- Function CUSTOM_TEXTJOIN_FILTER(delimiter As String, rng1 As Range, rng2 As Range, criteria1 As Variant, rng3 As Range, criteria2 As Variant) As String
- Dim result As String
- Dim i As Long
- For i = 1 To rng1.Rows.Count
- If rng2.Cells(i, 1).Value = criteria1 And rng3.Cells(i, 1).Value = criteria2 Then
- result = result & rng1.Cells(i, 1).Value & delimiter
- End If
- Next i
- If Len(result) > 0 Then
- result = Left(result, Len(result) - Len(delimiter))
- End If
- CUSTOM_TEXTJOIN_FILTER = result
- End Function
-
复制代码 |
|