Bonjour,
Ca marche
Pourtant je croyais avoir essayé cela
Merçi
michel tanguy a écrit :
Bonsoir Vincent
Est-ce que la macro ci-dessous peut repondre à ta demande ?
Option Explicit
Sub FormatDansPlageCellule
Dim oSheet As Object,oPlage As Object
oSheet=ThisComponent.Sheets.getByName("Feuille1")
oPlage=oSheet.getCellRangeByPosition(0,0,3,3)
oPlage.NumberFormat = 11'pourcentage
End Sub
Bonne soiree
michel
-----Message d'origine-----
De : Vincent Morlot [mailto:vinc...@free.fr]
Envoyé : jeudi 10 juin 2004 23:16
À : pr...@fr.openoffice.org
Objet : [prog] [calc] format de cellule
Bonsoir,
Je cherche le moyen d'imposer à une cellule ou à un ensemble de cellules
un format d'affichage particulier ( %) à partir d'une macro. J'ai
trouvé des exemples comme ceci mais qui n'apporte pas de modifications
dim oFormats as Object
oFormats = xDoc.NumberFormats
dim aLocale as new com.sun.star.lang.Locale
......
Selection = Feuille.getCellRangeByPosition (2 + (cpt * 2), 3,3 + (cpt
* 2), 3)
Selection.NumberFormat = oFormats.getStandardFormat(
com.sun.star.util.NumberFormat.PERCENT, aLocale)
Merçi