Created
July 1, 2015 13:30
-
-
Save xight/fefc8da8a2993548d301 to your computer and use it in GitHub Desktop.
find merged cell from worksheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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