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
Buenas tardes Estimados ..por favor me pueden ayudar con error que me aparace cuando presiono el boton grabar
Private Sub CommandButton1_Click()
On Error Resume Next
Sheets("compras").Select
ULinea = Range("a" & Rows.Count).End(xlUp).Row + 1 'llevar desde formulario a planilla excel'
Range("A" & ULinea).Value = Me.TextBox5.Text
Range("B" & ULinea).Value = Me.TextBox4.Text
Range("C" & ULinea).Value = Me.TextBox18.Text
Range("D" & ULinea).Value = Me.TextBox2.Text
Range("E" & ULinea).Value = Me.TextBox8.Text
Range("F" & ULinea).Value = Me.TextBox9.Text
Range("G" & ULinea).Value = Me.TextBox10.Text
Range("H" & ULinea).Value = Me.TextBox6.Text
Range("I" & ULinea).Value = Me.TextBox7.Text
Range("J" & ULinea).Value = Me.ComboBox1.Value ' los textbox tienen extencion Txt'
Me.TextBox2.Text = ""
Me.TextBox3.Text = ""
Me.TextBox5.Text = ""
Me.TextBox6.Text = ""
Me.TextBox7.Text = ""
Me.TextBox8.Text = ""
Me.ComboBox1.Value = ""
TextBox2.SetFocus ' EL SetFocus devuelve el cursor al inicio´'
End Sub