Una familia de software de hoja de cálculo de Microsoft con herramientas para analizar, trazar y comunicar datos.
Sub p()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim m As Integer
Dim f As Integer
Dim Letra(8) As String
Letra(0) = "A"
Letra(1) = "B"
Letra(2) = "C"
Letra(3) = "D"
Letra(4) = "E"
Letra(5) = "F"
Letra(6) = "G"
Letra(7) = "H"
Letra(8) = "I"
f = 2
' genero las combinaciones
For i = 0 To 8
For j = i + 1 To 8
For k = j + 1 To 8
For m = k + 1 To 8
Cells(f, 1) = Letra(i) & Letra(j) & Letra(k) & Letra(m)
f = f + 1
Next
Next
Next
Next
' elimino la fila anterior si tiene tres letras iguales a la fila
For i = Cells(1000, 1).End(xlUp).Row To 2 Step -1
If ContarIguales(Cells(i, 1), Cells(i - 1, 1)) = 3 Then
Range("A:A").EntireRow(i).Delete
End If
Next
End Sub
Function ContarIguales(Texto1 As String, Texto2 As String) As Integer
Dim i As Integer
For i = 1 To 4
If InStr(Texto1, Mid$(Texto2, i, 1)) Then
ContarIguales = ContarIguales + 1
End If
Next
End Function