Sign in to follow this  
Followers 0
Syl21

RESOLVED: ExcelCOM_UDF.au3 and Merged Cells

3 posts in this topic

#1 ·  Posted (edited)

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

EndIf

if $Merged < 0 then

$Merged = 1

EndIf

Return $Merged

EndFunc ;==>_ExcelCellMerge

Enjoy

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
EndFunc

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  
Followers 0