Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Test for Merge

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?
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Test for Merge

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

"Gary''s Student" wrote:

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?
--
Gary's Student

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Test for Merge

Thanks a lot. I now have a better test for "sortability"
--
Gary's Student


"Toppers" wrote:

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

"Gary''s Student" wrote:

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?
--
Gary's Student

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
mail merge excludes my headers and critical data in Word merge Nix Excel Discussion (Misc queries) 0 April 21st 06 08:35 PM
Merge =( formula should retain fraction type numbers after merge. Aubrey Excel Worksheet Functions 0 February 9th 06 07:37 PM
how do i get my mail merge to update the data source at each merge Steel_Monkey Excel Discussion (Misc queries) 0 November 30th 05 08:41 AM


All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"