Supprimer caractère dans les cellules d'une colonne

Bonjour à tous.

Je cherche un code VBA pour supprimer la première lettre de chaque cellule d'une colonne si c'est un w. Je vous joins un fichier exemple. Merci à tous. Cordialement, legreffier

13exemple.xltm (11.15 Ko)

Bonjour Legreffier

Eassyer d'ajouter cela dans un module

Sub removeFirstCar(sColumn As String, firstRow As Long, sCar As String)
Dim iRow As Long, lastROw As Long
lastROw = Range(sColumn & CStr(firstRow)).End(xlDown).Row
For iRow = firstRow To lastROw
  If Mid(Cells(iRow, sColumn), 1, 1) = LCase(sCar) Or Mid(Cells(iRow, sColumn), 1, 1) = UCase(sCar) Then
     Cells(iRow, sColumn) = Mid(Cells(iRow, sColumn), 2)
  End If
Next
End Sub

Sub SupprCar()
Call removeFirstCar("B", 9, "w")
End Sub

Merci scraper, c'est le top ! Bonne soirée

Rechercher des sujets similaires à "supprimer caractere colonne"