Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nick.pattison
 
Posts: n/a
Default how can I use a function to find out if an individual cell is par.

I need to be able to tell if a cell at a given cell reference is part of a
merged group of cells or not
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Nick,

You need to use a User-Defined Function, code given below. Copy the code
into a code module, and use it like

=IsMerged(A1)

It will return TRUE if A1 is part of a merged cell, FALSE otherwise.

HTH,
Bernie
MS Excel MVP


Function IsMerged(inCell As Range) As Boolean
IsMerged = inCell.MergeCells
End Function


"nick.pattison" wrote in message
...
I need to be able to tell if a cell at a given cell reference is part of a
merged group of cells or not



  #3   Report Post  
Bernd Plumhoff
 
Posts: n/a
Default

Maybe this udf helps.

Regards,
Bernd

-------- snip here, press ALT + F11, insert module, put
code in ---------

Option Explicit

Public Function IsMerged(varRange As Variant, varCell As
Variant) As Boolean
'True if varCell belongs to merged cell range varRange,
'false if varRange not merged or varCell not part of
varRange

Dim ivarRange As Variant

IsMerged = False

For Each ivarRange In varRange

If ivarRange.MergeCells And ivarRange.Address =
varCell.Address Then

IsMerged = True
Exit Function

End If

Next ivarRange

End Function

--------- snip here ------------------

-----Original Message-----
I need to be able to tell if a cell at a given cell

reference is part of a
merged group of cells or not
.

  #4   Report Post  
nick.pattison
 
Posts: n/a
Default

thanks very much... I have adapted it a little and it seems to work nicely

"Bernd Plumhoff" wrote:

Maybe this udf helps.

Regards,
Bernd

-------- snip here, press ALT + F11, insert module, put
code in ---------

Option Explicit

Public Function IsMerged(varRange As Variant, varCell As
Variant) As Boolean
'True if varCell belongs to merged cell range varRange,
'false if varRange not merged or varCell not part of
varRange

Dim ivarRange As Variant

IsMerged = False

For Each ivarRange In varRange

If ivarRange.MergeCells And ivarRange.Address =
varCell.Address Then

IsMerged = True
Exit Function

End If

Next ivarRange

End Function

--------- snip here ------------------

-----Original Message-----
I need to be able to tell if a cell at a given cell

reference is part of a
merged group of cells or not
.


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
Using the MAX function with "constant increment" cell references John Dwyer Excel Worksheet Functions 3 December 10th 04 03:37 PM
Is there a function for "not isblank" (find a cell that has a val. Jim Excel Worksheet Functions 3 December 8th 04 07:29 AM
copy a cell value not its function KC Mao Excel Discussion (Misc queries) 2 December 4th 04 04:30 AM
Find a Function to use accross different worksheets R. Hale Excel Worksheet Functions 3 November 25th 04 07:07 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 11:43 PM.

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

About Us

"It's about Microsoft Excel"