Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete row using vba

Status
Not open for further replies.

User4Fun

Programmer
Aug 6, 2008
15
US
My delete entire row is not working. Any ideas


Code:
 intRow = 44
    For intRow = intLastRow To intRow Step -1
      intFound = Cells(intLastRow, intCol).Value
         If intFound >= intFirstNum Then
                       If intFound <= intSecondNum Then
                              MsgBox intFound & " is Good to keep"
                               intLastRow = intLastRow - 1
                       Else
                              EntireRow.Delete

                              
                       End If
        Else
          EntireRow.Delete
        End If
        Next intRow
 



Code:
[b]
Cells(intRow, intCol).[/b]entirerow.delete

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
For intRow = intLastRow To 44 Step -1
intFound = Cells(intRow, intCol).Value
If intFound < intFirstNum Or intFound > intSecondNum Then
Cells(intRow, intCol).EntireRow.Delete
End If
Next intRow

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV???????????????????
You are my HEROOOOOOOOOOOOOOOOOOOOOO
that is all i needed, one set of fresh smart eyes

THank you thank you
I have been stuck here for two days.

I had it as < AND >
that is so stupid, I cannot have a numbeer to be smaller than and at the same time bigger than a number that is bigger than the first one???

thank you
 
User4Fun,

Generally, in these forums, if a post is helpful, you put a little pinky pointy thing called a star on it.

The part that says:

"Thank PHV for this valuable post!" is what you click, and then "Confirm."

That way, others will know that at least one person found this helpful, and therefore they might as well. It also serves as at least some for of recognition for the one who did solve the particular problem/question.

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top