Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wish to merge all empty cells in a selection with the first non
empty cell above retaining that value e.g. Smith <empty <empty Jones Bloggs <empty Smith) )Merged ) Jones Bloggs) )Merged and so on... any ideas? Pete |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MergeCells()
Dim rng As Range, cell As Range, ar As Range Set rng = Selection.SpecialCells(xlBlanks) For Each ar In rng.Areas Set cell = ar.Offset(-1, 0).Resize(ar.Rows.Count + 1) cell.Merge Next End Sub Special cells is restricted to the usedrange, so make sure the cells at the bottom in the selection are included in the usedrange. -- Regards, Tom Ogilvy "Pete" wrote in message m... I wish to merge all empty cells in a selection with the first non empty cell above retaining that value e.g. Smith <empty <empty Jones Bloggs <empty Smith) )Merged ) Jones Bloggs) )Merged and so on... any ideas? Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically merge mulitiple cells to one cells | Excel Worksheet Functions | |||
How to merge two cells? | Excel Discussion (Misc queries) | |||
how do I merge cells into one then delete the original cells? | Excel Worksheet Functions | |||
Merge Cells | Excel Discussion (Misc queries) | |||
How do I merge cells in Excel, like just 2 cells to make one big . | Excel Discussion (Misc queries) |