Jump to content
Sign in to follow this  

RESOLVED: ExcelCOM_UDF.au3 and Merged Cells

Recommended Posts


Hello everybody...

I'have a problem about merged cells

i'm using this "#include <ExcelCOM_UDF.au3>"

I can merge or unmerge cells but i don't want that

I just want know how many collums my merged cell take???

can you help me please???

do you know how to create a include fonction???

thanks in advance...

Edited by Syl21

Share this post

Link to post
Share on other sites

I have create a function...

If someone want to better it and had it to ExcelCOM_UDF.au3, it's a pleasure for me...

Func _ExcelIsThisCellMerged($oExcel, $RowStart, $ColStart)

If NOT IsObj($oExcel) Then Return SetError(1)

If NOT StringRegExp($RowStart, "[A-Z,a-z]", 0) Then

If $ColStart < 1 Then Return SetError(2)

$Merged = $oExcel.Cells($RowStart, $ColStart).MergeCells


if $Merged < 0 then

$Merged = 1


Return $Merged

EndFunc ;==>_ExcelCellMerge


Share this post

Link to post
Share on other sites

Dim $oXl = ObjGet( "", "Excel.Application" )

Func _ExcelIsCellMerged( $oExcel, $sAddress )
    ; beware: sending only rc coordinates assumes the Activesheet context.
    ; To ensure that the correct sheet is assumed, pass in the sheet name:
    ;    example: $sAddress = "Sheet1!A1"
    Return $oExcel.Application.Range($sAddress).MergeArea.Columns.Count > 1

Dim $result = _ExcelIsCellMerged( $oXl, "Sheet1!A1" ) 
ConsoleWrite( $result & @CRLF)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.