5 messages in org.openoffice.fr.progRe: [prog] format de cellule dans calc
FromSent OnAttachments
Kohler GerardSep 8, 2008 12:58 am 
Laurent GodardSep 8, 2008 1:11 am 
Kohler GerardSep 8, 2008 1:36 am 
Laurent GodardSep 8, 2008 2:02 am 
Kohler GerardSep 8, 2008 2:03 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] format de cellule dans calcActions...
From:Kohler Gerard (koh@oceanetpro.net)
Date:Sep 8, 2008 1:36:55 am
List:org.openoffice.fr.prog

Laurent Godard a écrit :

Bonjour

existe-t-il une méthode simple pour formater une cellule en date ?

ca peut dependre de ton contexte mais en definissant un style, formatté en date dans l'onglet nombre et ensuite en l'appliquant à la cellule (CellStyle) ?

voici ma macro de test :

REM ***** BASIC *****

sub Main dim mondoc as object dim mafeuille as object dim cellout, cellin as object

mondoc = thisComponent mafeuille = mondoc.Sheets.getByName("Feuille1")

cellout = mafeuille.getCellByPosition(0,0) cellin = mafeuille.getCellByPosition(1,0) cellin.Value = cellout.Value

end sub

*************************

la cellule (0,0) contient une date formatée (JJ/MM/AA) Comment formater la cellule (1,0) ?

si je fait :

cellin.cellStyle = cellout.cellStyle

ç marche pô ! :-D