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:Francois Gatto (oo@volcar.org)
Date:Jan 28, 2007 10:44:44 pm
List:org.openoffice.fr.prog

Salut JF,

Jean-Francois Nifenecker a écrit :

Francois Gatto a écrit :

Bonsoir JF,

Je pense qu'avec ceci tu devrais obtenir satisfaction .. not like the The Rolling Stones ;)

Sub ChangeCellRangeBackground Dim oSheet oSheet = ThisComponent.getSheets().getByName( "Feuille1" ) oSheet.getCellRangeByName("A10:IV20").CellBackColor = rgb(127,100,127) End Sub

Merci François !

Mmmm... Je m'as mal esprimé.

Je voudrais appliquer la macro que j'avais réalisée à une sélection quelconque (que l'utilisateur ferait). En d'autres termes, comment obtient-on la sélection courante ?

A+

Une variante :

Sub SelectedRangeBackColor Dim oDoc As Object Dim oSheet As Object Dim oSelection As Object Dim aColNames() Dim deb, fin

oDoc = ThisComponent oSheet = oDoc.getSheets().getByIndex(0) oSelection = oDoc.getCurrentSelection()

aColNames() = oSelection.Columns.getElementNames() deb = aColNames(LBound(aColNames()) deb = deb & oSelection.getRangeAddress.StartRow fin = aColNames(UBound(aColNames()) fin = fin & oSelection.getRangeAddress.EndRow

'msgbox deb & " " & fin

oSelection.CellBackColor = rgb(255,0,0) End Sub

Francois