skidragon02
New Member
Hello,
I am using the following Macro in Excel 2013 and receiving an error message that simply says "400" and prevents the macro from adjusting my margins appropriately. Does someone know what is causing the problem? Thanks in advance for the help!
I am using the following Macro in Excel 2013 and receiving an error message that simply says "400" and prevents the macro from adjusting my margins appropriately. Does someone know what is causing the problem? Thanks in advance for the help!
Code:
Sub Column_Widths()
Dim i As Integer
Dim ws As Worksheet
Application.ScreenUpdating = False
For i = 3 To 11
With Sheets(i)
.Columns("A:A").ColumnWidth = 5.57
.Columns("B:B").ColumnWidth = 11.71
.Columns("C:C").ColumnWidth = 8.86
.Columns("D:D").ColumnWidth = 8.86
.Columns("E:E").ColumnWidth = 9.43
.Columns("F:F").ColumnWidth = 2.86
.Columns("G:G").ColumnWidth = 17#
.Columns("H:H").ColumnWidth = 7.29
.Columns("I:I").ColumnWidth = 32#
.Columns("J:J").ColumnWidth = 32#
.Columns("K:K").ColumnWidth = 16.29
.Columns("L:L").ColumnWidth = 7.71
.Columns("M:M").ColumnWidth = 10.29
.Columns("N:N").ColumnWidth = 4.86
.Columns("O:O").ColumnWidth = 7.14
.Columns("P:P").ColumnWidth = 4.86
.Columns("Q:Q").ColumnWidth = 6.29
.Columns("R:R").ColumnWidth = 5.57
.Rows("3:183").EntireRow.AutoFit
End With
Next
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: