I recorded this. It specifically finds the PM column header.
Then sets the column width.
Sub Set_Col_Wid_PM()
Range("A1").Select
Cells.Find(What:="PM", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False).Activate
Columns("E:E").Select
Selection.ColumnWidth = 5.14
End Sub
Open in new window
I'd like to abstract this so I can pass the column name and desired width. e.g.
= Set_Col_Wid("PM", 5.14)
Open in new window
Is there a way to 'generalize'
Columns("E:E").Select so that it knows what column to select, regardless of its location?
Can you help?
ActiveCell.EntireColumn.Co