Hello guys

I've a data Base which i make some hidden columns to PRINT PDF, although i want now to autofit ROWS according to Columns Visible

I found this on the internet, although i cannot make this to work

My first data is on A9 (row and column)
Sheet name is "BD CLIENTES"


Sub AFitCols()    '*
    '** Autofit starting at row 9 (IQC is the WorkSheet name).
    '*
    Dim MaxRows As Long
    Dim MyRng As Variant
    Dim A As Range, Cel As Range
    
    ActiveWorkbook.Sheets("BD CLIENTES").Activate
    MaxRows = ActiveSheet.UsedRange.Rows.Count - 9
    '*
    '** We want colums A  to AA, so in the Cells we specify 1 to 27.
    '*
    Set MyRng = Range(Cells(1, 1), Cells(MaxRows, 27)).Offset(9).SpecialCells(xlCellTypeVisible)
    MyRng.Rows.AutoFit
    '*
    '** Increase row widths by set amount
    '*
    For Each Cel In MyRng.Columns(1).Cells
        Cel.RowWidth = Cel.RowWidth + 2
    Next
    Range("A9").Select
    
End Sub 'AFitCols