J
joe
I am trying to write a macro to set column widths and the
last statement (regardless which is last) always overrides
all previous sizings. I recorded the macro, and my
spreadsheet was fine, but when runing that macro, it
worked quite differently. This is my code:
Columns("A:A").Select
Selection.ColumnWidth = 12
Range("A1:H1").Select
Columns("B:B").Select
Selection.ColumnWidth = 15
Range("A1:H1").Select
Columns("C:C").Select
Selection.ColumnWidth = 7
Range("A1:H1").Select
Columns("D
").Select
Selection.ColumnWidth = 13
Range("A1:H1").Select
Columns("E:E").Select
Selection.ColumnWidth = 11
Range("A1:H1").Select
Columns("F:F").Select
Selection.ColumnWidth = 15
Range("A1:H1").Select
Columns("G:G").Select
Selection.ColumnWidth = 20
Range("A1:H1").Select
Columns("H:H").Select
Selection.ColumnWidth = 5
Range("A1:H1").Select
What is up with that? I have some merged cells, but they
were not a concern when I did the recording.
last statement (regardless which is last) always overrides
all previous sizings. I recorded the macro, and my
spreadsheet was fine, but when runing that macro, it
worked quite differently. This is my code:
Columns("A:A").Select
Selection.ColumnWidth = 12
Range("A1:H1").Select
Columns("B:B").Select
Selection.ColumnWidth = 15
Range("A1:H1").Select
Columns("C:C").Select
Selection.ColumnWidth = 7
Range("A1:H1").Select
Columns("D
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
Selection.ColumnWidth = 13
Range("A1:H1").Select
Columns("E:E").Select
Selection.ColumnWidth = 11
Range("A1:H1").Select
Columns("F:F").Select
Selection.ColumnWidth = 15
Range("A1:H1").Select
Columns("G:G").Select
Selection.ColumnWidth = 20
Range("A1:H1").Select
Columns("H:H").Select
Selection.ColumnWidth = 5
Range("A1:H1").Select
What is up with that? I have some merged cells, but they
were not a concern when I did the recording.