TenDollarTypo
IS-IT--Management
How could I modify this code to make it merge every 9 cells in one column or two/three columns if I like:
Dim iRow As Integer, lRowStart As Long, iColStart As Integer
Dim iMrgRws As Integer, iMrgCls As Integer, iColCnt As Integer
Dim iRwsCnt As Long
lRowStart = 2 'start row
iColStart = 1 'start column
iMrgRws = 9 '# rows to merge
iMrgCls = 2 '# columns to merge
iColCnt = 1 'column count
iRwsCnt = 1 'row count
With ActiveSheet
For iRow = lRowStart To iRwsCnt * iMrgRws Step iMrgRws
.Range(.Cells(lRowStart, iRow), .Cells(lRowStart + (iMrgRws - 1), iRow + (iMrgRws - 1))).Merge
Next
End With
End Sub
Any suggestion would be helpful?
Dim iRow As Integer, lRowStart As Long, iColStart As Integer
Dim iMrgRws As Integer, iMrgCls As Integer, iColCnt As Integer
Dim iRwsCnt As Long
lRowStart = 2 'start row
iColStart = 1 'start column
iMrgRws = 9 '# rows to merge
iMrgCls = 2 '# columns to merge
iColCnt = 1 'column count
iRwsCnt = 1 'row count
With ActiveSheet
For iRow = lRowStart To iRwsCnt * iMrgRws Step iMrgRws
.Range(.Cells(lRowStart, iRow), .Cells(lRowStart + (iMrgRws - 1), iRow + (iMrgRws - 1))).Merge
Next
End With
End Sub
Any suggestion would be helpful?