Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using the MAX function with "constant increment" cell references | Excel Worksheet Functions | |||
Is there a function for "not isblank" (find a cell that has a val. | Excel Worksheet Functions | |||
copy a cell value not its function | Excel Discussion (Misc queries) | |||
Find a Function to use accross different worksheets | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |