This is a general purpose macro to adjust the width of columns. It worked well but now I am adding the code to set a minimum width. I don't understand why Dim oCol as column results in a type mimatch at the highlighted row.
Gavin
Code:
'Adjust the Width
iWidth = 8 'Default minimum width
With Range(ActiveCell.Offset(1, 0), ActiveCell.SpecialCells(xlLastCell))
iWidth = InputBox("Enter Minimum Width for your data columns " & .Columns.Address, _
"GKMacros FormatHeaderRows", _
iWidth) 'input box to ask for minimum width
.Columns.AutoFit
[red]For Each oCol In .Columns()[/red]
If oCol.Width < iWidth Then .Width = iWidth
Next oCol
End With
Gavin