Comment ré-écrire ce qui suit pour inclure la colonne A (A2 jusquà la fin)
et la colonne B (B2 jusqu'à la fin)?
----------------------
Sub EnleveAccent()
' Cette MACRO enlève tous les caractères accentuées et spécaux
Dim c As Range, Ctr As Long, i As Integer
For Each c In Range([A2], Cells(Rows.Count, 1).End(xlUp))
c.Value = Sans_accents$(c.Value)
Next c
End Sub
--------------------------------------------
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value = Sans_accents$(c.Value) Next End Sub
isabelle
Le 2014-11-22 14:50, Albert a écrit :
Bonjour
Comment ré-écrire ce qui suit pour inclure la colonne A (A2 jusquà la fin) et la colonne B (B2 jusqu'à la fin)? ---------------------- Sub EnleveAccent() ' Cette MACRO enlève tous les caractères accentuées et spécaux Dim c As Range, Ctr As Long, i As Integer For Each c In Range([A2], Cells(Rows.Count, 1).End(xlUp)) c.Value = Sans_accents$(c.Value) Next c End Sub --------------------------------------------
Merci
bonjour,
Sub test()
Dim c As Range, rw As Long
rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count,
2).End(xlUp).Row)
For Each c In Range("A2:B" & rw)
If WorksheetFunction.IsText(c.Value) Then c.Value = Sans_accents$(c.Value)
Next
End Sub
isabelle
Le 2014-11-22 14:50, Albert a écrit :
Bonjour
Comment ré-écrire ce qui suit pour inclure la colonne A (A2 jusquà la fin) et la
colonne B (B2 jusqu'à la fin)?
----------------------
Sub EnleveAccent()
' Cette MACRO enlève tous les caractères accentuées et spécaux
Dim c As Range, Ctr As Long, i As Integer
For Each c In Range([A2], Cells(Rows.Count, 1).End(xlUp))
c.Value = Sans_accents$(c.Value)
Next c
End Sub
--------------------------------------------
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value = Sans_accents$(c.Value) Next End Sub
isabelle
Le 2014-11-22 14:50, Albert a écrit :
Bonjour
Comment ré-écrire ce qui suit pour inclure la colonne A (A2 jusquà la fin) et la colonne B (B2 jusqu'à la fin)? ---------------------- Sub EnleveAccent() ' Cette MACRO enlève tous les caractères accentuées et spécaux Dim c As Range, Ctr As Long, i As Integer For Each c In Range([A2], Cells(Rows.Count, 1).End(xlUp)) c.Value = Sans_accents$(c.Value) Next c End Sub --------------------------------------------
Merci
GL
Le 23/11/2014 20:48, isabelle a écrit :
bonjour,
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value > Sans_accents$(c.Value) Next End Sub
isabelle
Ce qu'il y a de bien avec BASIC, c'est qu'il y a 12 mille façons de faire la même chose, sans qu'on sache bien laquelle est la meilleure.
Alors qu'on attendrait d'un langage de macro un truc du style :
For Each c in CellsOf("A2:B*", TextValues+Constants) { ... }
qui est clair, parlant, et forcément aussi beaucoup plus efficace pour un ordinateur.
Bonne soirée.
Le 23/11/2014 20:48, isabelle a écrit :
bonjour,
Sub test()
Dim c As Range, rw As Long
rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row,
Cells(Rows.Count, 2).End(xlUp).Row)
For Each c In Range("A2:B" & rw)
If WorksheetFunction.IsText(c.Value) Then c.Value > Sans_accents$(c.Value)
Next
End Sub
isabelle
Ce qu'il y a de bien avec BASIC, c'est qu'il y a 12 mille façons
de faire la même chose, sans qu'on sache bien laquelle est la meilleure.
Alors qu'on attendrait d'un langage de macro un truc du style :
For Each c in CellsOf("A2:B*", TextValues+Constants) { ... }
qui est clair, parlant, et forcément aussi beaucoup plus efficace pour
un ordinateur.
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value > Sans_accents$(c.Value) Next End Sub
isabelle
Ce qu'il y a de bien avec BASIC, c'est qu'il y a 12 mille façons de faire la même chose, sans qu'on sache bien laquelle est la meilleure.
Alors qu'on attendrait d'un langage de macro un truc du style :
For Each c in CellsOf("A2:B*", TextValues+Constants) { ... }
qui est clair, parlant, et forcément aussi beaucoup plus efficace pour un ordinateur.
Bonne soirée.
Albert
Merci Isabelle
"isabelle" a écrit dans le message de news:m4tdmp$ivn$
bonjour,
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value = Sans_accents$(c.Value) Next End Sub
isabelle
Merci
-- albertri-at-videotron.ca.invalid
Merci Isabelle
"isabelle" <i@v.org> a écrit dans le message de
news:m4tdmp$ivn$1@speranza.aioe.org...
bonjour,
Sub test()
Dim c As Range, rw As Long
rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count,
2).End(xlUp).Row)
For Each c In Range("A2:B" & rw)
If WorksheetFunction.IsText(c.Value) Then c.Value =
Sans_accents$(c.Value)
Next
End Sub
"isabelle" a écrit dans le message de news:m4tdmp$ivn$
bonjour,
Sub test() Dim c As Range, rw As Long rw = Application.Max(Cells(Rows.Count, 1).End(xlUp).Row, Cells(Rows.Count, 2).End(xlUp).Row) For Each c In Range("A2:B" & rw) If WorksheetFunction.IsText(c.Value) Then c.Value = Sans_accents$(c.Value) Next End Sub