compare

2
Compare.xls Eliminación de Registros 10 BLUE BIG 50 BLUE SMALL 40 BLACK BIG 40 BLACK BIG 45 WHITE SMALL 45 YELLOW BIG 50 RED BIG 10 RED BIG 85 SAND SMALL 85 SAND BIG 45 RED SMALL 45 RED SMALL 10 RED BIG 50 RED BIG Deseamos eliminar las filas en las que los registros sean iguales Con los datos anteriores se eliminaran las filas 6 y 10. Sub DeleteMatches() Dim i As Integer With ActiveSheet For i = .Range("B5").End(xlDown).Row To 5 Step -1 If .Cells(i, 2) = .Cells(i, 6) And .Cells(i, 3) = .Cells(i, 7) .Cells(i, 1).EntireRow.Delete End If Next End Wit

Upload: renequispesoncco

Post on 18-Nov-2015

213 views

Category:

Documents


0 download

DESCRIPTION

ompare

TRANSCRIPT

Sheet1Compare.xlsEliminacin de Registros Comunes10BLUEBIG50BLUESMALL40BLACKBIG40BLACKBIG45WHITESMALL45YELLOWBIG50REDBIG10REDBIG85SANDSMALL85SANDBIG45REDSMALL45REDSMALL10REDBIG50REDBIGDeseamos eliminar las filas en las que los registros sean igualesCon los datos anteriores se eliminaran las filas 6 y 10.Sub DeleteMatches()Dim i As IntegerWith ActiveSheetFor i = .Range("B5").End(xlDown).Row To 5 Step -1If .Cells(i, 2) = .Cells(i, 6) And .Cells(i, 3) = .Cells(i, 7) And .Cells(i, 4) = .Cells(i, 8) Then.Cells(i, 1).EntireRow.DeleteEnd IfNextEnd Wit

Attribute VB_Name = "Hoja1"Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = TrueOption Explicit

Sub DeleteMatches() Dim i As Integer With ActiveSheet For i = .Range("B5").End(xlDown).Row To 5 Step -1 If .Cells(i, 2) = .Cells(i, 6) And .Cells(i, 3) = .Cells(i, 7) And .Cells(i, 4) = .Cells(i, 8) Then .Cells(i, 1).EntireRow.Delete End If Next End WithEnd Sub

Attribute VB_Name = "ThisWorkbook"Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = TrueAttribute VB_TemplateDerived = FalseAttribute VB_Customizable = True