![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#17
|
|||
|
|||
|
I understand and I appreciate all of your efforts thus far. Perhaps you could try explaining what this code below is actually doing. To start with, how does the program know the criteria you listed?
Code:
'Format the remaining cells, in groups of 5.
'The first cell in each group spans two rows and
'the first row in each group contains 4 cells but
'the second row contains 1 cell spanning the width
'of the last 3 cells of the first row
For i = 5 To .Cells.Count
'If it's the first cell in a group, ensure it's both merged and centred vertically
If ((i Mod 5) + 1) = 1 Then
If .Cells(i + 4).ColumnIndex = 1 Then
Set Rng = .Cells(i).Range
Rng.End = .Cells(i + 4).Range.End
Rng.Select: Selection.Cells.Merge
End If
|
| Tags |
| column width, combine, tables |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Table will not allow sorting because "cells are merged". I can't find the merged cells.
|
wendyloooo | Word Tables | 1 | 05-26-2015 01:19 PM |
| Splitting one column into two with two different widths | officeboy09 | Excel | 6 | 12-15-2013 09:48 PM |
| Pasting tables from Excel 2010 into Word 2010 - How to fix column widths? | GracieB | Word | 7 | 10-02-2013 06:24 AM |
| Adjusting column widths | norwood | Word VBA | 0 | 09-24-2013 06:53 AM |
VBA code to fix column widths
|
molesy | Excel | 3 | 09-16-2013 12:51 PM |