How do I detect if a cell in excel is merged?
If the cell is merged how do I read the value?
Hurray! Figured out a way to check whether a cell is merged and return that cell's value:
Sub checkCellMerged1()
'With ThisWorkbook.ActiveSheet
Set ma = ActiveCell.MergeArea
On Error GoTo errHand
If ma = ActiveCell Then MsgBox ActiveCell.Address & " is not merged"
GoTo final
errHand:
If Err.Number = 13 Then MsgBox "Merged Address = " & ma.Address _
& vbCrLf & "Value = " & ma(1).Value
final:
On Error GoTo 0
'End With
End Sub