9 messages in org.openoffice.fr.progRe: [prog] Appliquer une macro à la s...
FromSent OnAttachments
Jean-Francois NifeneckerJan 28, 2007 8:32 am 
Francois GattoJan 28, 2007 8:55 am 
Jean-Francois NifeneckerJan 28, 2007 9:09 am 
Anthony BenoistJan 28, 2007 9:49 am 
Jean-Francois NifeneckerJan 28, 2007 9:57 am 
christianwtdJan 28, 2007 11:55 am 
Manuel NAUDINJan 28, 2007 10:41 pm 
Francois GattoJan 28, 2007 10:44 pm 
Jean-Francois NifeneckerFeb 8, 2007 6:44 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Appliquer une macro à la sélectionActions...
From:christianwtd (chri@free.fr)
Date:Jan 28, 2007 11:55:27 am
List:org.openoffice.fr.prog

Jean-Francois Nifenecker a écrit :

Et pour parcourir toutes les lignes de la sélection, une boucle ? Comment trouve-t-on la première et la dernière lignes de la zone ?

Bonsoir Jean-François,

Une solution qui appartient à Troumad

Sub AdresseCoordZone '******************************************* '*** Merci Troumad pour AdresseCoordZone *** '******************************************* Dim MonDoc As Object, NomFeuille As String, Selection, SelectRange, AdrSelection MonDoc = ThisComponent Selection = MonDoc.CurrentSelection SelectRange = Selection.RangeAddress NomFeuille = MonDoc.sheets(SelectRange.sheet).name 'Coordonnées X1 = SelectRange.StartColumn Y1 = SelectRange.StartRow X2 = SelectRange.EndColumn Y2 = SelectRange.EndRow 'Adresse AdrSelection = AdrCell(X1, Y1) '1ére cellule if (X1-X2)+(Y1-Y2) <> 0 then AdrSelection = AdrSelection & ":" & AdrCell(X2,Y2) End if print X1, Y1, X2, Y2 'pour info print NomFeuille & "." & AdrSelection 'pour info End sub

Function AdrCell(X as long, Y as long) as String Dim param as variant , AccesFonction as object AccesFonction = createUnoService("com.sun.star.sheet.FunctionAccess") param = Array(Y+1,X+1,4) AdrCell = AccesFonction.CallFunction("ADDRESS",param()) End function

Voila, pour lire tu fais un For..Next et normalement ça roule.

Bonne prise de tête, pardon, bonne soirée ;-)

Bon surf, Christian