R
RyanH
I have a worksheet that I need to delete rows. The first row is always 10,
but the second row can vary past 10. I was wondering if there is quick
function or cleaner way of writing code to find the last row in Col.B that
contains an interior colorindex = 50? This is what I have.
Sub DeleteRows()
' find green line at end of quote sheet
lngLastRow = 10
Do Until Cells(lngLastRow, 2).Interior.ColorIndex = 50
lngLastRow = lngLastRow + 1
Loop
' delete rows (items) from quote sheet
Rows("10:" & lngLastRow).Delete Shift:=xlUp
End Sub
but the second row can vary past 10. I was wondering if there is quick
function or cleaner way of writing code to find the last row in Col.B that
contains an interior colorindex = 50? This is what I have.
Sub DeleteRows()
' find green line at end of quote sheet
lngLastRow = 10
Do Until Cells(lngLastRow, 2).Interior.ColorIndex = 50
lngLastRow = lngLastRow + 1
Loop
' delete rows (items) from quote sheet
Rows("10:" & lngLastRow).Delete Shift:=xlUp
End Sub