There is a difference between the Selection
and the Activecell
. Activecell
is always only one cell - the cell that has the focus. With your select-statement, you change the Activecell
to the first cell of the selection - in your case C6
. Your alignment statement just sets the alignment of that cell.
You could change your code to selection.horizontalAlignment = xlleft
. However, before you do that, you should understand that it is not necessary to select anything in VBA and you should avoid it for many reasons. Please read How to avoid using Select in Excel VBA
You could write
range("C6", range("C6").end(xldown)).horizontalAlignment = xlleft
I still don't like that because it assumes that the sheet you're working with is active (which is not necessary either), but it leads to far for this answer to explain all the details.