列で文字列を検索し、それを配列に格納する方法についてのヘルプを受け取りました。行全体を保存することは可能ですか?検索しましたが見つかりません。
文字列でデータを含む1枚のシートで検索したい。次に、その文字列を含む行を別のシートにコピーします。
私のコードは次のようになります。
Set wsRaw = Worksheets("raw_list")
Set phaseRange = wsRaw.Columns(PhaseCol)
SearchString = "start"
Set aCell = phaseRange.Find(What:=SearchString, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
Set bCell = aCell
ReDim Preserve arrStart(nS)
arrStart(nS) = aCell.Row
nS = nS + 1
Do While ExitLoop = False
Set aCell = phaseRange.FindNext(After:=aCell)
If Not aCell Is Nothing Then
If aCell.Row = bCell.Row Then Exit Do
ReDim Preserve arrStart(nS)
arrStart(nS) = aCell.Row
nS = nS + 1
Else
ExitLoop = True
End If
Loop
Else
End If
助けてくれてありがとう:)