willyboy58
Technical User
I am trying to select a range of cells for left justifying. The columns are from A to D with all the rows in these columns. When I run the following procedure, the only cell that gets left justified is the very last cell in column A.
I have tried with the range ("A
"
as well as ("A1
1"
in the pro below. What am I missing?
TIA, Bill
Sub LeftJustifyCells()
ActiveSheet.Range("A1
1"
.End(xlDown).Select
MsgBox "should select cells in range"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range("A1"
.Select
End Sub
I have tried with the range ("A
TIA, Bill
Sub LeftJustifyCells()
ActiveSheet.Range("A1
MsgBox "should select cells in range"
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range("A1"
End Sub