Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to merge cells in column A when the adjacent vertical cells are
the same. For example: Col A Row1 CX457 Row2 AG925 Row3 AG925 Row4 AG925 Row5 RB639 Row6 RB639 In this case A2, A3 & A4 would be merged, A5 & A6 would be merged. Is there a way to do this automatically? Thanks, Joe M. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'd recommend against merging cells. Why not use a conditional format and if
the cells match, have one of them change to a white font? "Joe M." wrote: I would like to merge cells in column A when the adjacent vertical cells are the same. For example: Col A Row1 CX457 Row2 AG925 Row3 AG925 Row4 AG925 Row5 RB639 Row6 RB639 In this case A2, A3 & A4 would be merged, A5 & A6 would be merged. Is there a way to do this automatically? Thanks, Joe M. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Merged? As in concatenated (added together to read RB639 RB639 in a
single cell)? Or do you want to show only a single occurence if the entry occurs multiple times? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
what do you mean by merging cells?
merging can mean anything from summing up values. Deleting duplicates, to formatting several cells to appear as one cell. "Joe M." wrote: I would like to merge cells in column A when the adjacent vertical cells are the same. For example: Col A Row1 CX457 Row2 AG925 Row3 AG925 Row4 AG925 Row5 RB639 Row6 RB639 In this case A2, A3 & A4 would be merged, A5 & A6 would be merged. Is there a way to do this automatically? Thanks, Joe M. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry for not being clear. In this case, merge as to format several cells to
appear as one cell. "bj" wrote: what do you mean by merging cells? merging can mean anything from summing up values. Deleting duplicates, to formatting several cells to appear as one cell. "Joe M." wrote: I would like to merge cells in column A when the adjacent vertical cells are the same. For example: Col A Row1 CX457 Row2 AG925 Row3 AG925 Row4 AG925 Row5 RB639 Row6 RB639 In this case A2, A3 & A4 would be merged, A5 & A6 would be merged. Is there a way to do this automatically? Thanks, Joe M. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have had a lotr of trouble with merged cells over the years, but a brute
force macro to do what you want would be Sub test() rt = 1 For r = 2 To 50000 If Cells(r, 1) = "" Then GoTo 99 If Cells(r - 1, 1) < Cells(r, 1) Then rt = r: GoTo 99 If Cells(r - 1, 1) = Cells(r + 1, 1) Then GoTo 99 If Cells(r - 1) = Cells(r, 1) Then Range(Cells(rt, 1), Cells(r, 1)).Select With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = True End With End If 99 Next r change the formating of the merged cells as you would like them to appear End Sub "Joe M." wrote: Sorry for not being clear. In this case, merge as to format several cells to appear as one cell. "bj" wrote: what do you mean by merging cells? merging can mean anything from summing up values. Deleting duplicates, to formatting several cells to appear as one cell. "Joe M." wrote: I would like to merge cells in column A when the adjacent vertical cells are the same. For example: Col A Row1 CX457 Row2 AG925 Row3 AG925 Row4 AG925 Row5 RB639 Row6 RB639 In this case A2, A3 & A4 would be merged, A5 & A6 would be merged. Is there a way to do this automatically? Thanks, Joe M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to run formula only on cells with data | Excel Discussion (Misc queries) | |||
Formula in macro or in sheet/cells? | Excel Worksheet Functions | |||
Merge =( formula should retain fraction type numbers after merge. | Excel Worksheet Functions | |||
Excel Macro - Merge Cells unavailable - Unable to figue out why. | Excel Worksheet Functions | |||
repeat macro formula to all cells | Excel Discussion (Misc queries) |