Al escribir fórmulas debemos evitar siempre que podamos anidar funciones SI (sobre todo cuando tenemos información que se repite).
Por favor, prueba la siguiente fórmula:
=SI.ERROR(
LET(
id, B3,
fecha_ref, F3,
rango_ids, '[Base Snte 05 Coah 2.xlsx]Pagos'!$F$2:$F$10000,
rango_fechas, '[Base Snte 05 Coah 2.xlsx]Pagos'!$K$2:$K$10000,
rango_resultado, '[Base Snte 05 Coah 2.xlsx]Pagos'!$D$2:$D$10000,
diferencia, ABS(rango_fechas - fecha_ref),
filtro, (rango_ids = id) * diferencia,
min_dif, MIN.SI.CONJUNTO(diferencia, rango_ids, id),
fila, COINCIDIR(min_dif, filtro, 0),
INDICE(rango_resultado, fila)
),
"No encontrado")Coméntanos si funciona.
Por
Sergio, · 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