Test for Merge

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the easiest way to code a Boolean UDF that, given a range as input,
will return TRUE if any cell in that range is merged and FALSE otherwise?
 
Hi,

Try this:

=isMerge(A1:H1) in required cell

Function IsMerge(inRng)
For Each cell In inRng
If cell.MergeCells Then
IsMerge = True
Exit Function
End If
Next cell
IsMerge = False
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top