Dear! I need help with excel.
I have a mail database with approximately 5-10 columns and 100 - 50000 rows.
I sort them by postal code.
After that I give them autofits in height and width.
I add one row at the beginning.
Now i should somehow need all the colums in the first, empty,
row filled with AxxxxxA (This AxxxA is defined by the columne width but must start with A and ended with A)
But some colums have 3 letters and some 30.
How to make a macro for that?
This is how I have now but I do not have AxxxxA
Sub mmmmAutoWidth()
Cells.Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Font.Bold = True
Selection.Font.Bold = False
With Selection.Font
.Name = "Arial Narrow"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Dim mCell As Range
Application.ScreenUpdating = False
For Each mCell In ActiveSheet.UsedRange.Rows(1).Cells
mCell.EntireColumn.AutoFit
Next mCell
Application.ScreenUpdating = True
Selection.Rows.AutoFit
Selection.Columns.AutoFit
End Sub