Results 1 to 4 of 4

Simplified Macro

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Simplified Macro

    is there a way to simplified this macro
    Thank you very much appreciate any help
    Sub DataCleaner()
    LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 1 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 2 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 3 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 4 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 5 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 6 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 8 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 9 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For x = LastRow To 2 Step -1
    If Cells(x, 19).Value = 1546 And Cells(x, 7).Value = 10 Then
    Cells(x, 1).EntireRow.Delete
    End If
    Next
    End Sub
    Last edited by martinez_pedro; 03-17-2011 at 09:47 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1