View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ty Ty is offline
external usenet poster
 
Posts: 3
Default Selecting and merging range within numerous rows

I'm trying to write a code that merges cells from column B to L within
that row (i.e. merge B21:L21 all the way to B1120:L1120). My code
merges colums BI to BN through all rows (one monster cell). I'm
assuming a For-Next loop is the way to go but am certainly having
trouble getting the range called correctly.

Dim i As Integer

For i = 20 To 1120
Range("Bi:Li").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = True
End With
Next i
End Sub

I'd greatly appreciate any help.

Cheers,
Ty