How can I check in VBA if the userselection contains two different mergedareas next to each other?
thanks
roland
How can I check in VBA if the userselection contains two different mergedareas next to each other?
thanks
roland
Not sure if this is what you are asking but here is some code that will allow you to detect if the current cell is made up of two or more horizontally merged cells:
Public Sub CheckMerged()
CurrentCell = ActiveCell.Column
NeighborCell = ActiveCell.Offset(0, 1).Column
If NeighborCell - CurrentCell > 1 Then
MsgBox "Current cell consists of merged cells across the row"
End If
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks