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
ojala me ayuden con esta macro q en el 2003 funciona perfecto , pero en 2007 se cae al toque
me aparece algo de un error 1004 tiempo ejecución , pero no logro repararla, esto pq me borraran el 2003
y me urge q funcione, es una macro para enviar varios correos con información de excel
la macro es
Private Sub ENVIAR_EMAIL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False ' para q no salga aviso al final
HMAIL.Activate
HSAL.Cells.Clear
HMAIL.Cells.Copy HSAL.Cells
'Workbooks(L3).SaveCopyAs ThisWorkbook.Path & "\LOCAL " & COL.List(x, 0) & ".xls"
ActiveWorkbook.EnvelopeVisible = True 'permite enviar mas de 1 correo a la vez 'aca se cae!!
With ActiveSheet.MailEnvelope
'.Introduction = "Estimado Sr. " & COL.List(x, 4)
.Introduction = COL.List(x, 4) & Chr(13) & "Adjunto avances" & Chr(13) & _
"gestión"
.Item.To = COL.List(x, 2) 'Destinatario
'.Item.Subject = COL.List(x, 0) & "-" & COL.List(x, 1) 'Asunto
.Item.Subject = "Avance" 'Asunto
For n = 3 To 100
If Cells(n, 2) = "" And Cells(n, 8) <> "" Then
Cells(n + 1, 2) = "contactarse con" & Chr(10) & "pp" & Chr(10) & "Atentamente," & Chr(10) & "Gerencia"
Cells(n + 1, 2).HorizontalAlignment = xlLeft
'Cells(n + 2, 2).VerticalAlignment = xlCenter
'Cells(n + 2, 2).WrapText = True
Else
End If
Next n
Columns("A:j").Select
Columns("A:j").EntireColumn.AutoFit
.Item.Send 'enviamos el mail
End With
gracias
oliver