A
Al
I’ve got these few lines of code that work fine on for a group of cells I’m
calling “Large†that starts on row 5:
Columns("A:A").Select
Selection.Find(What:="Large", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(2, 1).Range("A1").Select
NumRows = Range("B5", Range("B5").End(xlDown)).Rows.Count
For x = 1 To NumRows
If ActiveCell.Offset(0, -1) = "SEL" Or ActiveCell.Offset(0, -1) = "Asset
CL" Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.Range("A1:S1").Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(0, 1).Select
End If
Next
I’m looking for a modification for the next group of cells.
How might I re-define “NumRows†to handle all my cell groups that start on
rows further down my sheet?
calling “Large†that starts on row 5:
Columns("A:A").Select
Selection.Find(What:="Large", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(2, 1).Range("A1").Select
NumRows = Range("B5", Range("B5").End(xlDown)).Rows.Count
For x = 1 To NumRows
If ActiveCell.Offset(0, -1) = "SEL" Or ActiveCell.Offset(0, -1) = "Asset
CL" Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.Range("A1:S1").Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(0, 1).Select
End If
Next
I’m looking for a modification for the next group of cells.
How might I re-define “NumRows†to handle all my cell groups that start on
rows further down my sheet?