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
Hola a todos,esta macro me da problemas de compilacion,alguien me podria indicar la solucion?
La intencion es que solo me borre las filas que sean diferentes a la condicion
Gracias a todos
Sub Macro1()
'
' Macro1 Macro
' Macro grabada el 21/11/2012 por Paco
'
'
Dim Rango As Range, Fila As Long, ÚltimaFila As Long
Application.ScreenUpdating = False
ÚltimaFila = 1
For Fila = ActiveSheet.UsedRange.Row To ÚltimaFila
Application.StatusBar = "Procesando fila " & Fila & " / " & ÚltimaFila
If (Range("I" & Fila).Value <> TRANSPORTES Y LOGISTICA SORIA, S.L.) Then en esta linea me da el error
If Rango Is Nothing = True Then
Set Rango = Rows(Fila)
Else
Set Rango = Application.Union(Rango, Rows(Fila))
End If
End If
Next Fila
If Rango Is Nothing = False Then
Rango.Select
Selection.Delete
ActiveCell.Select
End If
Application.StatusBar = "Listo"
Application.ScreenUpdating = True
End Sub
Gracias a todos