Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
find merged cell from worksheets
' usage
' Call("Sheet1", "A1", "Z100")
Sub findMergedCell(strWorkSheet As String, strStartCell As String, strEndCell As String)
Dim cl
Dim msg
Dim rng
rng = strStartCell & ":" & strEndCell
For Each cl In Worksheets(strWorkSheet).Range(rng)
If cl.MergeCells = True Then
If cl.MergeArea(1).Address = cl.Address Then
msg = msg & vbCrLf & cl.Address
End If
End If
Next
MsgBox msg
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment