Te anexo la macro
Sub Informe_Usuario()
'
' Por.Dante Amor
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set h1 = Sheets(1)
Set h2 = Sheets("Plantilla")
Set h3 = Sheets("Informe")
h3.Cells.Clear
'
If h1.AutoFilterMode Then h1.AutoFilterMode = False
u = h1.Range("C" & Rows.Count).End(xlUp).Row
With h1.Sort
.SortFields.Clear
.SortFields.Add Key:=h1.Range("C2:C" & u) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=h1.Range("D2:D" & u) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange h1.Range("A1:E" & u): .Header = xlYes: .MatchCase = False
.Orientation = xlTopToBottom: .SortMethod = xlPinYin: .Apply
End With
'
i = 2
ant = h1.Cells(i, "C")
h2.Cells.Copy h3.[A1]
h3.Range("A2") = h3.Range("A2") & " " & ant
h3.Columns("A:B").NumberFormat = "dd-mm-yyyy"
'
Do While h1.Cells(i, "C") <> ""
If ant <> h1.Cells(i, "C") Then
'guarda hoja
H3. Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & "Informe UL" & ant
ActiveWorkbook. Close
'nuevo informe
H3. Cells. Clear
h2.Cells.Copy h3.[A1]
h3.Range("A2") = h3.Range("A2") & " " & h1.Cells(i, "C")
h3.Columns("A:B").NumberFormat = "dd-mm-yyyy"
End If
Select Case h1.Cells(i, "E") 'estado
Case "", "PENDIENTE"
h3.Rows(8).Insert
h3.Cells(8, "A") = h1.Cells(i, "A") 'incidencia
h3.Cells(8, "B") = h1.Cells(i, "D") 'fecha
Case "HECHO"
Set b = h3.Columns("A").Find(h1.Cells(i, "D"), lookat:=xlWhole)
If Not b Is Nothing Then
h3.Cells(b.Row, "B") = h3.Cells(b.Row, "B") & ", " & h1.Cells(i, "A") 'incidencia
Else
msj = "El trabajador/a ha hecho la/s incidencia/s "
u3 = h3.Range("A" & Rows.Count).End(xlUp).Row + 1
h3.Cells(u3, "A") = h1.Cells(i, "D") 'fecha
h3.Cells(u3, "B") = msj & h1.Cells(i, "A") 'incidencia
End If
End Select
ant = h1.Cells(i, "C")
i = i + 1
Loop
MsgBox "Proceso terminado"
End Sub
.
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
.