PDA

View Full Version : Align all text in Left and all numeric values in center in a given range using vba.



LalitPandey87
02-29-2012, 06:43 PM
Hi All,

Hope you all are good.
I need a VBA procedure which will align all the text in Left and all the numeric in center in a given range.

Thanks in advance.

Excel Fox
02-29-2012, 07:45 PM
Modify as needed



ActiveSheet.UsedRange.SpecialCells(2, 2).HorizontalAlignment = xlLeft
ActiveSheet.UsedRange.SpecialCells(2, 1).HorizontalAlignment = xlCenter




https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA (https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA)

LalitPandey87
02-29-2012, 08:24 PM
Thanks for your valuable support it is the same what i want.
Thanks Again.