Related:         
- Macro for deleting row with condition
- Saints row 2 cheats - Guide
- How to delete a row in word - Guide
- Excel online macro - Guide
- Excel run macro on open - Guide
- Macro for number to words in excel - Guide
6 responses
                
        
                    husssaid
    
        
                    Posts
            
                
            2
                
                            Registration date
            Tuesday March 10, 2009
                            Status
            Member
                            Last seen
            March 11, 2009
            
                    
Mar 11, 2009 at 05:57 AM
    Mar 11, 2009 at 05:57 AM
                        
                            
                    I have pasted table with some other information not in the table , needs to delete rows that the fourth column does not contain an number
                
                
            
                        
                    Private Sub Delete()
Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub
The macro above will not delete blank rows. If you need to delete blank rows also in the range then use this.
Private Sub Delete()
Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Or Cells(intRow, 1) = "" Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub
            Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub
The macro above will not delete blank rows. If you need to delete blank rows also in the range then use this.
Private Sub Delete()
Dim intRow
Dim intLastRow
intLastRow = Range("A65536").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value > 5 Or Cells(intRow, 1) = "" Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub
                
        
                    arunv.cse@gmail.com
    
        
                    Posts
            
                
            2
                
                            Registration date
            Thursday October 29, 2009
                            Status
            Member
                            Last seen
            November 11, 2009
            
                    
Nov 11, 2009 at 04:54 AM
    Nov 11, 2009 at 04:54 AM
                        
                    hi,,,,,i want to delete the empty column but,,having  values  in header.... that is in a1 cell...how to delete the entire column....also the heading...
.....
            .....
                
        
                    provock
    
        
                    Posts
            
                
            31
                
                            Registration date
            Monday December 29, 2008
                            Status
            Member
                            Last seen
            June 18, 2009
            
            
                    3
    
    
                    
Feb 10, 2009 at 01:57 AM
    Feb 10, 2009 at 01:57 AM
                        
                    I'm not very fnd of creating macro or VBA stuffs, but if you want a good example of a macro use to delete rows , just copy and paste this link in the address bar of your browser :https://docs.microsoft.com/en-us/office/troubleshoot/excel/delete-every-other-row
                
                
            
                
        
                    hero85
    
        
                    Posts
            
                
            7
                
                            Registration date
            Thursday March 12, 2009
                            Status
            Member
                            Last seen
            May 14, 2009
            
            
                    8
    
    
                    
Mar 16, 2009 at 11:09 AM
    Mar 16, 2009 at 11:09 AM
                        
                    do you do small macro work for small money?
                
                
            
                
        
                    critenlee
    
        
                    Posts
            
                
            2
                
                            Registration date
            Friday August 21, 2009
                            Status
            Member
                            Last seen
            August 21, 2009
            
                    
Aug 21, 2009 at 07:43 PM
    Aug 21, 2009 at 07:43 PM
                        
                    Thanks so much for sharing the post. 
Links removed as reported spam
            Links removed as reported spam
