固定行の値と異なる列の値を結合したいのですが、空白セルをスキップします。コードはありますが、機能しません。提案してください
Public Function SuperJoin(r1 As Range, r2 As Range, IgnoreBlanks As Boolean) As String
Dim i As Long, j As Long
Dim s As String
j = r2.Cells.Count
For i = 1 To j
If IgnoreBlanks = True Then
If r2.Cells(i) = True Then
If r2.Cells(i).Value <> "" Then s = s & "-" & r2.Cells(i)
End If
Else
If r2.Cells(i) = True Then
s = s & "-" & r2.Cells(i)
End If
End If
Next
i = r1.Count
For j = 1 To i
SuperJoin = SuperJoin & "----" & r1(1, j) & r2(1, j)
Next j
SuperJoin = Mid(SuperJoin, 5)
End Function