更新 vba_code_common.bas

This commit is contained in:
2026-04-14 02:21:18 +00:00
parent 1effcf34e7
commit 8e8cd994e1

View File

@@ -182,3 +182,13 @@ Sub ToggleAutoFilter(Optional ByVal filterRow As Long = 6)
End If
End If
End Sub
Sub AutoFitColumnWidth(Optional ByVal fitColumnStart As Long = 2, _
Optional ByVal fitColumnEnd As Long = 9)
Dim ws As Worksheet
Set ws = ActiveSheet
If fitColumnStart <= fitColumnEnd Then
ws.Columns(fitColumnStart & ":" & fitColumnEnd).AutoFit
End If
End Sub