I have a VBA Code that Unmerges the merge cells and fill in the values for those cells.
I want the functionality of filling in the values to happen only if the merged cells belong to same column.
Sub UnMergeFill()
Dim cell As Range, joinedCells As Range
For Each cell In ThisWorkbook.ActiveSheet.UsedRange
If cell.MergeCells Then
Set joinedCells = cell.MergeArea
cell.MergeCells = False
' I need an if loop here to check if the Range happens to be in the same column
joinedCells.Value = cell.Value
End If
Next
End Sub
For Example, I want all the cells to be unmerged. But only the Test2 values needs to be dragged down to those cells as they all belong to the same column. The test value shouldn't as it goes across different columns.