Thread: MergeCell range
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gus Chuch Gus Chuch is offline
external usenet poster
 
Posts: 12
Default MergeCell range

I got a form that Im using to put text in a cell (one word only), how can I
tell how many cells this word occupied (columns) so I can do a mergecell for
the number of cells? Im going to then set that to a MaxLen and if the next
word occupies more cells then the previous that will be my new MaxLen.

If MaxLen < NumberOfCell Then MaxLen = NumberOfCell

Range(Cells(Row , StartCol), Cells(Row ,(StartCol + Maxlen)).Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With

--
thank You
gus