Select column & format


Posted by George on March 23, 2001 9:33 AM

Tried to record a macro to select a column and then align horizontal text within the column to "general". Resulting macro selects specific column (F) instead of selecting whatever column the highlighted cell at the time I run the macro resides in.
Can anyone help, please?

Selection.End(xlUp).Select
Columns("F:F").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Selection.End(xlUp).Select
End Sub

Posted by mseyf on March 23, 2001 10:59 AM

try using
ActiveCell.EntireColumn.Select
to select the active column

Mark

Posted by mseyf on March 23, 2001 11:09 AM

if all you want to do chage the alignment, you can reduce the entire macro to one line:

ActiveCell.EntireColumn.HorizontalAlignment = xlGeneral

Mark




Posted by George on March 23, 2001 11:40 AM

Mark, you are a scholar and a gentleman. Thanks.