For i = LBound(配列,1) to UBound(配列,1) For j = データの一番上の行 to データの一番下の行 If Cells(j,1).Value = 配列(i,LBound(配列,2) Then If 配列(i,UBound(配列,2) <>″″ Then ReDim Preserve 配列(LBound(配列,1) to UBound(配列,1),LBound(配列,2) to UBound(配列,2)+1) End If For k = LBound(配列,2) to UBound(配列,2) If 配列(i,k) = Cells(j,1),Value Then Exit For Else If 配列(i,k) = ″″ Then 配列(i,k) = Cells(j,1),Value End If Next Next Next