Supprimer texte entre deux caractères plusieurs fois ds une cell [Résolu/Fermé]
Signaler
Stridou...
Stridou...
- Messages postés
- 52
- Date d'inscription
- mardi 29 juillet 2014
- Statut
- Membre
- Dernière intervention
- 22 octobre 2014
Stridou...
- Messages postés
- 52
- Date d'inscription
- mardi 29 juillet 2014
- Statut
- Membre
- Dernière intervention
- 22 octobre 2014
A voir également:
- Supprimer texte entre deux caractères plusieurs fois ds une cell
- Supprimer texte entre deux caractères plusieurs fois ds une cell ✓ - Forum - Excel
- Extraire texte entre 2 caractères excel ✓ - Forum - Excel
- Excel extraire texte entre deux caractères - Forum - Excel
- Javascript: récupérer texte entre 2 caractere ✓ - Forum - Javascript
- Extraire une chaine contenue entre deux guillemets, excel 2010 ✓ - Forum - Excel
2 réponses
Stridou...
- Messages postés
- 52
- Date d'inscription
- mardi 29 juillet 2014
- Statut
- Membre
- Dernière intervention
- 22 octobre 2014
Une solution a été trouvée, voici le code :
Function parenthese(cellule)
Application.Volatile
temp = cellule
pos1 = InStr(temp, "%")
pos2 = InStr(temp, ".")
While pos1 <> 0 And pos2 <> 0
If pos1 > 1 Then
tmp = Left(temp, pos1)
End If
If pos2 > 0 Then
tmp = tmp & Mid(temp, pos2 + 1)
End If
If pos1 + pos2 = 0 Then tmp = temp
temp = tmp
pos1 = InStr(pos1 + 1, temp, "%")
pos2 = InStr(pos1 + 1, temp, ".")
Wend
parenthese = Trim(tmp)
End Function
Function parenthese(cellule)
Application.Volatile
temp = cellule
pos1 = InStr(temp, "%")
pos2 = InStr(temp, ".")
While pos1 <> 0 And pos2 <> 0
If pos1 > 1 Then
tmp = Left(temp, pos1)
End If
If pos2 > 0 Then
tmp = tmp & Mid(temp, pos2 + 1)
End If
If pos1 + pos2 = 0 Then tmp = temp
temp = tmp
pos1 = InStr(pos1 + 1, temp, "%")
pos2 = InStr(pos1 + 1, temp, ".")
Wend
parenthese = Trim(tmp)
End Function
Maurice
bonjour
voila une macro
Sub testMot()
Mots = Range("O9").Value
Mots = Replace(Mots, "GAU.", "")
Mots = Replace(Mots, "DROI.", "")
Mots = Replace(Mots, "DE.", "")
Mots = Replace(Mots, "DER.", "")
Range("O9").Value = Mots
End Sub
a voir si ca te va
A+
Maurice
voila une macro
Sub testMot()
Mots = Range("O9").Value
Mots = Replace(Mots, "GAU.", "")
Mots = Replace(Mots, "DROI.", "")
Mots = Replace(Mots, "DE.", "")
Mots = Replace(Mots, "DER.", "")
Range("O9").Value = Mots
End Sub
a voir si ca te va
A+
Maurice