Así lo he hecho, he aceptado la segunda columna de anotación y he añadido una macro: Private Sub Worksheet_Calculate() Dim f As Long Dim disparar As Boolean ' Si ya se disparó una vez, salimos If Me.Range("XX2").Value <> "" Then Exit Sub ' Comprobamos si alguna W llegó a 2 For f = 2 To 6 If Me.Cells(f, "W").Value = 2 Then disparar = True Exit For End If Next f ' Si ninguna llegó a 2, no hacemos nada If disparar = False Then Exit Sub ' Guardamos TODO el rango como base For f = 2 To 6 Me.Cells(f, "XX").Value = Me.Cells(f, "W").Value ' Fórmula en Y restando su base Me.Cells(f, "Y").FormulaLocal = _ "=CONTAR.SI.CONJUNTO(Datos!B:B;$V$1;Datos!D:D;$V" & f & ")" & _ "-CONTAR.SI.CONJUNTO(Datos!B:B;$V$1;Datos!E:E;$V" & f & ")" & _ "-XX" & f Next f End Sub No es la opción más bonita porque sigue contando los objetos en la columna W, pero la función me resulta suficiente para poder llevar la cuenta. Tendré que hacer una pequeña macro para cada jugadora, son 14, pero espero no tener problemas
Por
Maku , · publicado el 25 de enero 25 ene
Hola.
Actualmente estoy utilizando una macro para filtrar contenidos pero como la base de datos se ha hecho bastante grande tarda mas de cinco minutos en ejecutarla.
Sub Borrado_Articulos_filtro()
Dim FILAFINAL As Long
Dim X As Long
Sheets(1).Select
FILAFINAL = Sheets(1).Range("A" & Rows.Count).End(xlUp).Row
For X = FILAFINAL To 2 Step -1
'VALORES COLUMNA H
If Sheets(1).Cells(X, 8) = "CG346A" Then
Cells(X, 1).Select
Cells(X, 1).EntireRow.Delete
End If
If Sheets(1).Cells(X, 8) = "ARTICULO 1" Then
Cells(X, 1).Select
Cells(X, 1).EntireRow.Delete
End If
If Sheets(1).Cells(X, 8) = "ARTICULO 2" Then
Cells(X, 1).Select
Cells(X, 1).EntireRow.Delete
End If
If Sheets(1).Cells(X, 8) = "ARTICULO 3" Then
Cells(X, 1).Select
Cells(X, 1).EntireRow.Delete
End If
If Sheets(1).Cells(X, 8) = "ARTICULO 4" Then
Cells(X, 1).Select
Cells(X, 1).EntireRow.Delete
End If
Next X
End Sub
La pregunta es:
Alguien me puede facilitar una macro que haga la misma función a través de un array de articulos u otro sistema pero que no tarde tanto en ejecutarse?