Attribute VB_Name = "CleanAndFormatSheet" ' Limpia la hoja activa: encabezado en negrita, recorta texto, autoajusta y congela el encabezado. Sub CleanAndFormatSheet() Dim ws As Worksheet, c As Range Set ws = ActiveSheet Application.ScreenUpdating = False With ws.Rows(1) .Font.Bold = True .Interior.Color = RGB(21, 101, 192) .Font.Color = vbWhite End With For Each c In ws.UsedRange.Cells If VarType(c.Value) = vbString Then c.Value = Trim(c.Value) Next c ws.UsedRange.Columns.AutoFit ws.Range("A2").Select ActiveWindow.FreezePanes = True Application.ScreenUpdating = True End Sub