Hi there,
I am working with a VBA code to help clean up some formatting within my excel workbooks. I am using the below code in one workbook, but when i try to apply it to another (larger) workbook I receive an error. The two workbooks are exactly the same, except one has more sheets than the other (contents of each sheet are more or less the same).
The error message I am getting is Run-time error 1004: Unable to set the Hidden property of the Range class. It seems like it is pointing to the Hidden Row component of the code.
Sub Row_Column_workbook()
Dim ws As Worksheet
For Each ws In Worksheets
With ws
.Columns("M:S").ColumnWidth = 0.25
.Rows("46:71").RowHeight = 0.5
.Columns("T:XFD").Hidden = True
.Rows("73:1048576").Hidden = True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
End With
Next ws
End Sub
Any insight is greatly appreciated.
Thank you,
Kayla
I am working with a VBA code to help clean up some formatting within my excel workbooks. I am using the below code in one workbook, but when i try to apply it to another (larger) workbook I receive an error. The two workbooks are exactly the same, except one has more sheets than the other (contents of each sheet are more or less the same).
The error message I am getting is Run-time error 1004: Unable to set the Hidden property of the Range class. It seems like it is pointing to the Hidden Row component of the code.
Sub Row_Column_workbook()
Dim ws As Worksheet
For Each ws In Worksheets
With ws
.Columns("M:S").ColumnWidth = 0.25
.Rows("46:71").RowHeight = 0.5
.Columns("T:XFD").Hidden = True
.Rows("73:1048576").Hidden = True
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
End With
Next ws
End Sub
Any insight is greatly appreciated.
Thank you,
Kayla