고정 행 값을 다른 열 값과 결합하고 싶지만 빈 셀을 건너뛰고 싶습니다. 코드가 있지만 작동하지 않습니다. 제안해주세요
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