Hello. Is it possible to create a macro button that merges and centers an specific column range. i.e. A2:A10?. Thanks.
Hello. Is it possible to create a macro button that merges and centers an specific column range. i.e. A2:A10?. Thanks.
Yes It is possible. Please check with the given code and customize as your need. Let me know if you are unsure of something.
Range("A2:A10").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
Last edited by Paul; 03-05-2010 at 02:26 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks