The below code selects the sheet but fails to align the cells to center.
wb.Sheets(1).Columns("A:L").Select
With Selection
.VerticalAlignment = xlCenter
End With
Thanks!
wb.Sheets(1).Activate
wb.Sheets(1).Columns("A:L").Select
With Selection
.VerticalAlignment = xlCenter
End With
Selects the entire sheet but it's not changing the vertical alignment to center.
wb.Sheets(1).Columns("A:L").VerticalAlignment = xlCenter
Does nothing.
I don't want HorizontalAlignment :)
I found out the column has VerticalAlignment set to xlCenter but the Cells underneath the column do not have VerticalAlignment set to xlCenter.
VerticalAlignment& notHorizontalAlignment? just checking - PaulStockHorizontalAlignmentinstead ofVerticalAlignment? - Jaywb.Sheets(1)is the active worksheet otherwise it will fail. I am upvoting this question because it is a common trap for people learning to program VBA through recording macros. - adamleerich