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!

Excel Deleting rows using VBA

Status
Not open for further replies.

User4Fun

Programmer
Aug 6, 2008
15
US
First post here, Looking forward to meeting new people.
Any ideas what is wrong with this code.

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
 



Please post VBA code questions in Forum707.

Your original question not specific enough. Please explain exactly what is not working. Give data examples if necessary.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Just for reference, anyone who wants to see this one, it is located here: thread707-1492445

--

"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