Somewhat belatedly, a few variations on a theme, starting with a simple tidy up of the original code.

Option Explicit

Sub Test2()
' works with the active worksheet
' simple approach; no select ... selection

Range(Range("A1"), Range("A1").End(xlDown)).NumberFormat = "0"
Range(Range("B1"), Range("B1").End(xlDown)).NumberFormat = "0"
Range(Range("D1"), Range("D1").End(xlDown)).NumberFormat = "0"
Range(Range("F1"), Range("F1").End(xlDown)).NumberFormat = "0"
Range(Range("N1"), Range("N1").End(xlDown)).NumberFormat = "0"
Range(Range("T1"), Range("T1").End(xlDown)).NumberFormat = "0"
Range(Range("O1"), Range("O1").End(xlDown)).NumberFormat = "m/d/yyyy"
Range(Range("U1"), Range("U1").End(xlDown)).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"

Range(Range("G1:I1"), Range("G1:I1").End(xlDown)).NumberFormat = "$#,##0.00"

Range("C:D,J:M,F:F,P:P,S:T").EntireColumn.Hidden = True
Columns("E:E").EntireColumn.AutoFit
Rows("4:" & Rows.Count).EntireRow.AutoFit

End Sub

Sub Test3()
' works with the active worksheet

' determine how many rows of data there are
Dim lLR As Long
' if you have a fully populated column, say, column A
lLR = Range("A" & Rows.Count).End(xlUp).Row
'or, less reliable, possibly on the high side
lLR = ActiveSheet.UsedRange.Rows.Count

Range("A1:A" & lLR).NumberFormat = "0"
Range("B1:B" & lLR).NumberFormat = "0"
Range("D1:D" & lLR).NumberFormat = "0"
Range("F1:F" & lLR).NumberFormat = "0"
Range("N1:N" & lLR).NumberFormat = "0"
Range("T1:T" & lLR).NumberFormat = "0"
Range("O1:O" & lLR).NumberFormat = "m/d/yyyy"
Range("U1:U" & lLR).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"

Range("G1:I" & lLR).NumberFormat = "$#,##0.00"

Range("C:D,J:M,F:F,P:P,S:T").EntireColumn.Hidden = True
Columns("E:E").EntireColumn.AutoFit
Rows("4:" & lLR).EntireRow.AutoFit

End Sub

Sub Test4()

' to ensure code applies to a specific worksheet
Dim ws As Worksheet: Set ws = Sheets("Sheet1")
' change the sheet name in the line abobe as required

With ws
' determine how many rows of data there are
    Dim lLR As Long
    ' if you have a fully populated column, say, column A
    lLR = .Range("A" & .Rows.Count).End(xlUp).Row
    'or, less reliable, possibly on the high side
    lLR = .UsedRange.Rows.Count
    
    .Range("A1:A" & lLR).NumberFormat = "0"
    .Range("B1:B" & lLR).NumberFormat = "0"
    .Range("D1:D" & lLR).NumberFormat = "0"
    .Range("F1:F" & lLR).NumberFormat = "0"
    .Range("N1:N" & lLR).NumberFormat = "0"
    .Range("T1:T" & lLR).NumberFormat = "0"
    .Range("O1:O" & lLR).NumberFormat = "m/d/yyyy"
    .Range("U1:U" & lLR).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
    
    .Range("G1:I" & lLR).NumberFormat = "$#,##0.00"
    
    .Range("C:D,J:M,F:F,P:P,S:T").EntireColumn.Hidden = True
    .Columns("E:E").EntireColumn.AutoFit
    .Rows("4:" & lLR).EntireRow.AutoFit
End With 'ws

End Sub

Sub Test5()

' to ensure code applies to a specific worksheet
Dim ws As Worksheet: Set ws = Sheets("Sheet1")
' change the sheet name in the line abobe as required

With ws
' determine how many rows of data there are
    Dim lLR As Long
    ' if you have a fully populated column, say, column A
    lLR = .Range("A" & .Rows.Count).End(xlUp).Row
    'or, less reliable, possibly on the high side
    lLR = .UsedRange.Rows.Count
    
    Union(.Range("A1").Resize(lLR), _
          .Range("B1").Resize(lLR), _
          .Range("D1").Resize(lLR), _
          .Range("F1").Resize(lLR), _
          .Range("N1").Resize(lLR), _
          .Range("T1").Resize(lLR) _
                ).NumberFormat = "0"
    
    .Range("O1:O" & lLR).NumberFormat = "m/d/yyyy"
    .Range("U1:U" & lLR).NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
    
    .Range("G1:I" & lLR).NumberFormat = "$#,##0.00"
    
    .Range("C:D,J:M,F:F,P:P,S:T").EntireColumn.Hidden = True
    .Columns("E:E").EntireColumn.AutoFit
    .Rows("4:" & lLR).EntireRow.AutoFit
End With 'ws

End Sub

Regards, TMS