Compare Column H and Column I

leonardo1234
Banned
Posts: 233
Joined: 28 Jul 2018, 17:29

Compare Column H and Column I

Post by leonardo1234 »

Compare Column H and Column I , if the value is more than double to each other then fine and if not then delete the row
I am pasting the result in sheet3 but I want the result in same sheet
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compare Column H and Column I

Post by HansV »

Here is another variation on Rudi's macro:

Code: Select all

Sub Delete_NotDouble()
    Application.ScreenUpdating = False
    Range("A1").EntireColumn.Insert
    Range("A1").CurrentRegion.Columns(1).FormulaR1C1 = "=RC[9]<=2*RC[8]"
    Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:="TRUE"
    With ActiveSheet.AutoFilter.Range
        On Error Resume Next
        .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Delete
        On Error GoTo 0
    End With
    ActiveSheet.AutoFilterMode = False
    Range("A1").EntireColumn.Delete
    Application.ScreenUpdating = True
End Sub
Best wishes,
Hans

leonardo1234
Banned
Posts: 233
Joined: 28 Jul 2018, 17:29

Re: Compare Column H and Column I

Post by leonardo1234 »

Thnx HansV Sir for giving ur precious time and great support to this post
Problem Solved