Public Sub DistributeColumnsEvenly()
Dim dSum As Double
Dim rCell As Range
With Selection
For Each rCell In .Rows(1).Cells
Debug.Print dSum, rCell.ColumnWidth
dSum = dSum + rCell.ColumnWidth
Next rCell
.ColumnWidth = dSum / .Columns.Count
End With
End Sub
If you're unfamiliar with macros, see David McRitchie's "Getting Started
with Macros"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.