5 messages in org.openoffice.fr.progRe: [prog] [Calc] Macros suite discus...
FromSent OnAttachments
Gérard LalouxNov 19, 2006 1:48 am 
christianwtdNov 19, 2006 2:15 am 
Gérard LalouxNov 19, 2006 2:32 am 
christianwtdNov 19, 2006 4:09 am 
Gérard LalouxNov 19, 2006 5:14 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] [Calc] Macros suite discussion entamée sur usersActions...
From:christianwtd (chri@free.fr)
Date:Nov 19, 2006 4:09:59 am
List:org.openoffice.fr.prog

Gérard Laloux a écrit :

Dernière petite question ... mais il n'y a aucune urgence (c'est dimanche et ça va bientôt être l'heure de l'apéro ...).

Macro de l'après apéro :-)

Sub SupprimeAccents Dim oDocument As Object, oSheet As Object Dim Col As Integer, Lig As Integer Dim x As Integer, y As Integer Dim LigDeb As Integer, LigFin As Integer Dim ColDeb As Integer, ColFin As Integer Dim Txt As String ' oDocument=ThisComponent Selection = oDocument.CurrentSelection SelectRange = Selection.RangeAddress ' 'Coordonnées plage sélectionnée ColDeb = SelectRange.StartColumn LigDeb = SelectRange.StartRow ColFin = SelectRange.EndColumn LigFin = SelectRange.EndRow ' oSheet=oDocument.currentController.ActiveSheet ' For y = ColDeb To ColFin For x = LigDeb to LigFin Txt = oSheet.getCellByPosition(y, x).getString Nc = Len(Txt) For n = 1 to Nc Car = Mid(Txt, n, 1) If Car = "é" Or Car ="è" Or Car = "ê" Or Car = "ë" Then Car = "e" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(y, x).setString(Txt) ElseIf Car = "â" Or Car ="à" Or Car ="ä" Then Car = "a" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(y, x).setString(Txt) ElseIf Car = "_" Or Car ="-" Then Car = "" Mid(Txt, n, 1) = Car oSheet.getCellByPosition(y, x).setString(Txt) Nc = Nc - 1 Endif Next n Next x Next y End Sub

Bon, si tu sélectionnes pas de cellules, dommage :-P

Bon surf, Christian