Я не уверен, но это то, что вы пытаетесь?
Option Explicit
Sub Sample()
Dim wsI As Worksheet
Dim lastRow As Long, lastCol As Long, i As Long, j As Long
Dim sVal1, sVal2, sVal3
'~~> Input Sheet
Set wsI = Sheets("Sheet1")
With wsI
lastRow = .Cells.Find(What:="*", After:=.Range("A1"), _
Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=False).Row
lastCol = .Cells.Find(What:="*", After:=.Range("A1"), _
Lookat:=xlPart, LookIn:=xlFormulas, SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, MatchCase:=False).Column
For i = 1 To lastRow
sVal1 = .Cells(i, 1).Value
sVal2 = .Cells(i, 2).Value
sVal3 = .Cells(i, 3).Value
For j = 4 To lastCol Step 3
If .Cells(i, j).Value = sVal1 And _
.Cells(i, j + 1).Value = sVal2 And _
.Cells(i, j + 2).Value = sVal3 Then
.Cells(i, j).ClearContents
.Cells(i, j + 1).ClearContents
.Cells(i, j + 2).ClearContents
End If
Next j
Next i
End With
End Sub
Вы имеете в виду 'H & SS GA0141 7/1/2006' находится в Col 2 и Col 3? Скриншот выборочных данных определенно поможет :) –
r1c1: GS r1c2: GA0202 r1c3: 7/1/2006 r2c1: H & SS r2c2: GA0141 r2c3: 7/1/2006 r2c4: H & SS r2c5: GA0141 r2c6: 7/1/2006 r2c7: H & SS r2c8: GA0141 r2c9: 7/1/2006 – dah97765
noob вопрос: разрешает ли SE загружать скриншоты или мы просто должны ссылаться на какой-то сторонний хост? – dah97765