Como dar formato a fila dinámica.
Tengo una macro que arma dos tablas de acuerdo a ciertos criterios.
Quisiera que el encabezado de la segunda tabla sea igual al de la primera. El formato necesario siempre esta en la fila 4 de la hoja destino donde se arman las dos tablas.
Sub Ejecutar()
'Encuentra el valor 1 en la celda U y los pasa a hoja PDF
Dim w As String
Application.ScreenUpdating = 0
With Sheets("PDF")
.[E2,A4:V8000].ClearContents
[A5:U5].AutoFilter 21, "=1"
Rows("5:5").EntireRow.Insert
[a6].CurrentRegion.Copy
.[a4].PasteSpecial xlValues
[G1].Copy: .[E2].PasteSpecial xlValues
w = .[E2].Value
.[E2] = "FECHA: " & w
Rows("5:5").Delete xlUp
Selection.AutoFilter
'
[A5:Y5].AutoFilter 24, "=2"
Rows("5:5").EntireRow.Insert
[a6].CurrentRegion.Copy
'
u = .Range("A" & Rows.Count).End(xlUp).Row + 2
.Cells(u - 1, "C") = "Base de datos actualizada"
'
.Range("A" & u).PasteSpecial xlValues
Rows("5:5").Delete xlUp
Selection.AutoFilter
'
Application.CutCopyMode = False
.[F:U].EntireColumn.Delete
.[A1:E4].Font.Bold = True
.[E2,F4:V8000].ClearContents
End With
Sheets("PDF").Select
Application.ScreenUpdating = 1
End Sub