Looping through rows

krice1974

Active Member
Joined
Jul 3, 2008
Messages
422
Hey there all, I'm working out of the book, and I'm close to what I need but at a beginner's block. I want to delete all rows of a table of stock information where the symbol (column b) contains a "." Here's what I've got:

Sub Earnings_SymbsClnUp()
'Deletes the newly posted trades that have a "." in the symbol.

Dim finalrow As Integer


Dim i As Integer
finalrow = Cells(Rows.Count, 1).End(xlUp).row - 8
MsgBox finalrow

For i = finalrow To 9 Step -1
If Cells(i, 2).Value = "ITRA" Then
Cells(1, 2).EntireRow.delete
End If
Next i

End Sub
 
Perfect! I love vba even though I'm lost. With help this good, I'm going to get lazy with my reading/studying it. :) Thanks to all.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top