100 A
101 B
102
103
104 E
101 BH
100 A
101 H
100 AA
100 AA
左からABC列となってます。
A列:ランダムな数字(検索値&範囲)
B列:ランダムな文字列(C列の表示条件)
B列が空白かつ、A列の別行に同じセルデータが入力されている行のC列に対し
該当するB列をすべて表示させるコードをご教授ください。
Sub test() Dim lastRow As Long Dim i As Long Dim j As Long lastRow = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To lastRow If Cells(i, 2).Value = "" Then For j = 1 To lastRow If Cells(i, 1).Value = Cells(j, 1).Value Then Cells(i, 3).Value = Cells(i, 3).Value & Cells(j, 2).Value End If Next j End If Next End Sub
いつもお世話になっております。
完璧です。
ありがとうございます。