• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel changes the Column Width when it should not

shree49

New Member
At our office, we use certain excel files which needs to be in certain format for column width. For example, a typical balance sheet would be Column A, B,C & D with the column width of 61, 11, 1, 11. Beginning this year, we noticed that those column width are getting changed to 60.58, 10.58, 0.94 etc.. not the same numbers everytime, and its not just one or two file. All the balance sheets for each client has this issue. Even after the column widths have been fixed, once it was used by someone else, the column widths got messed up again. We believe its not just one computer or one user.


Any insight on how to fix this? We have Windows XP & Office 2003
 
Shree49

There are a few times where Excel changes Column Widths

When External Data Links are in those columns and are updated

When Pivot tables are in those columns and are updated

When merge cells go across those columns and the values change in the merge cells and they are set to Autofit contents


There are ways to get around all the above


I suspect they don't apply to you anyway


You could add a small piece of VBA code to each worksheet that is applicable

[pre]
Code:
Private Sub Worksheet_Activate()
Columns("A:A").ColumnWidth = 61
Columns("B:B").ColumnWidth = 11
Columns("C:C").ColumnWidth = 1
Columns("D:D").ColumnWidth = 11
End Sub
[/pre]
Make sure you save the file as an Excel *.xlsm (Macro File) or *.xlsb (Binary File)
 
Back
Top