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
Private Sub TextBox10_Change()
Application.ScreenUpdating = False
On Error Resume Next
Dim cam As Integer
cam = Len(TextBox10.Text)
Select Case cam
Case 2
Me.TextBox10.Text = Me.TextBox10 & "/"
Case 5
Me.TextBox10.Text = Me.TextBox10 & "/"
End Select
Dim fecactual As Date
Dim fecnac As Date
Dim edadactual As String
fecnac = CDate(TextBox10.Value)
edadactual = DateDiff("d", fecnac, Now)
TextBox11.Text = edadactual
fecnac = CDate(TextBox10.Value)
edadactual = DateDiff("m", fecnac, Now)
TextBox12.Text = edadactual
fecnac = CDate(TextBox10.Value)
edadactual = DateDiff("yyyy", fecnac, Now)
TextBox13.Text = edadactual - 1
Application.ScreenUpdating = True
If TextBox11.Text <> Empty Then
TextBox11.Enabled = False
TextBox12.Enabled = False
TextBox13.Enabled = False
Else
TextBox11.Enabled = True
End If
End Sub