Bonjour,

2007/1/3, Franck Routier <[EMAIL PROTECTED]>:

Franck Routier a écrit :
>
>>
>> Essaie la fonction =CTXT()
> Je vais essayer ça...
>
Ok, ça marche avec : =CTXT(B2;0)
Puis copier et collage spécial (valeurs) dans une autre colonne, puis
tri sur cette colonne de valeurs texte


Je ne comprend pas bien pourquoi tu veux copier/coller dans une autre
colonne ?
Pourquoi ne pas garder celle-là (à moins que cela ne te serve qu'une seule
fois) ?
A voir aussi si c'est un import de données, si tu ne sais pas le faire dès
l'import en forçant le format à Texte.

Un peu lourd... mais gérable. Le seul regret, c'est qu'Excel puisse
convertir par l'application d'un "style" (oui,je suis d'accord, c'est
moins propre, mais c'est plus pratique), et que mais utilisateurs déjà
rétifs au changement y voient "encore" un argument...


Vive les macros après tout surtout si elles sont associées à un bouton ou un
raccourci clavier  ;)
exemple :
===debut macro=========
sub VersTexte
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 1
args1(1).Name = "Sel"
args1(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args1())

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "StringName"
args2(0).Value =
"=CTXT(DECALER(INDIRECT(CELLULE("+CHR$(34)+"address"+CHR$(34)+"));0;-1);0)"

dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())

rem ----------------------------------------------------------------------
dim args4(1) as new com.sun.star.beans.PropertyValue
args4(0).Name = "By"
args4(0).Value = 1
args4(1).Name = "Sel"
args4(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args4())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

rem ----------------------------------------------------------------------
dim args6(1) as new com.sun.star.beans.PropertyValue
args6(0).Name = "By"
args6(0).Value = 1
args6(1).Name = "Sel"
args6(1).Value = true

dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args6())

rem ----------------------------------------------------------------------
dim args7(1) as new com.sun.star.beans.PropertyValue
args7(0).Name = "By"
args7(0).Value = 1
args7(1).Name = "Sel"
args7(1).Value = true

dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData", "", 0,
args7())

rem ----------------------------------------------------------------------
dim args8(1) as new com.sun.star.beans.PropertyValue
args8(0).Name = "By"
args8(0).Value = 1
args8(1).Name = "Sel"
args8(1).Value = true

dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args8())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

rem ----------------------------------------------------------------------
dim args11(1) as new com.sun.star.beans.PropertyValue
args11(0).Name = "By"
args11(0).Value = 1
args11(1).Name = "Sel"
args11(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args11())

rem ----------------------------------------------------------------------
dim args12(1) as new com.sun.star.beans.PropertyValue
args12(0).Name = "By"
args12(0).Value = 1
args12(1).Name = "Sel"
args12(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoUpToStartOfData", "", 0,
args12())

rem ----------------------------------------------------------------------
dim args13(1) as new com.sun.star.beans.PropertyValue
args13(0).Name = "By"
args13(0).Value = 1
args13(1).Name = "Sel"
args13(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args13())

rem ----------------------------------------------------------------------
dim args14(5) as new com.sun.star.beans.PropertyValue
args14(0).Name = "Flags"
args14(0).Value = "SVDNT"
args14(1).Name = "FormulaCommand"
args14(1).Value = 0
args14(2).Name = "SkipEmptyCells"
args14(2).Value = false
args14(3).Name = "Transpose"
args14(3).Value = false
args14(4).Name = "AsLink"
args14(4).Value = false
args14(5).Name = "MoveMode"
args14(5).Value = 4

dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args14())

rem ----------------------------------------------------------------------
dim args15(1) as new com.sun.star.beans.PropertyValue
args15(0).Name = "By"
args15(0).Value = 1
args15(1).Name = "Sel"
args15(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args15())

rem ----------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "Flags"
args16(0).Value = "C"

dispatcher.executeDispatch(document, ".uno:DeleteCell", "", 0, args16())


end sub
===fin macro============
Yves.

Pas d'autre idée par hasard ?

Merci encore,

Franck

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
web site : http://www.molenbaix.com

Répondre à