Hello, I am trying to merge a number of cells in a specific column, if a given condition is met--the cells must contain identical information.
Here is the code I started with:
Range("A2:A5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
The problem is, I cannot hardcode the ranges as the number of identical cells may not be uniform (I may have 4 identical cells like in the example, but the next set could contain only 2). All identical cells will follow one another, so the dataset will have blocks of identical sets. Essentially, I am working with repeated measures, and I am trying to group/merge cells in the participant identifier column based on their unique identifier.
If anyone can offer any solutions, I would be very grateful
Here is the code I started with:
Range("A2:A5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
The problem is, I cannot hardcode the ranges as the number of identical cells may not be uniform (I may have 4 identical cells like in the example, but the next set could contain only 2). All identical cells will follow one another, so the dataset will have blocks of identical sets. Essentially, I am working with repeated measures, and I am trying to group/merge cells in the participant identifier column based on their unique identifier.
If anyone can offer any solutions, I would be very grateful
Last edited: