HI i am using a combination of code i received which looks like
Sub TopAlign() ‘ aligns the text
Cells.Select
With Selection
.VerticalAlignment = xlTop
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
.WrapText = True
End With
Range(“A2”).Select
End Sub
Sub ChooseAll() ‘ selects all the cells
ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Select
Range(ActiveCell, “a1”).Select
End Sub
Sub AutoSize() ‘ sets the size of the rows/columns ////problem in here
TopAlign
Columns(“E:E”).Select ‘ these 2 columns i want fixed widths for since they tend to get large
Selection.ColumnWidth = 42
Columns(“F:F”).Select
Selection.ColumnWidth = 42
ChooseAll
With Selection ‘ I would then like to aut fit the other remaining columns and rows to get my
‘ format correct.
.EntireRow.Select
.Columns.AutoFit
.EntireColumn.Select
.Rows.AutoFit
End With
End Sub
What happens is the 2 columns get set at 42 which is fine but the autofit of the rows still cuts off data when it is very long. So in essence itsnot really autosizing my rows. How can i manually set 2 column widths and then autosize the rest of my spreadsheet?
Thanks