Insertion de mots dans une phrase

  • Initiateur de la discussion Initiateur de la discussion maval
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

maval

XLDnaute Barbatruc
Bonjour,
J'ai une demande particulière
Voila je reçois les noms de ville avec son code INSSEE comme ceci

42 127 - MABLY

J'aimerais si possible l’insérer dans une ligne en sachant que c'est toujours la même configuration
AVANT
<td class="td_image"><a href=".html"><img src="../Blason_france/blason_alpha/.jpg" width="95" height="120" ></a></td>

APRÈS

<td class="td_image"><a href="MABLY.html"><img src="../Blason_france/blason_alpha/MABLY-42.jpg" width="95" height="120" ></a></td>

Je vous remercie d'avance ci-joint fichier explicatif

Cordialement

Max
 

Pièces jointes

Bonjour,

Testes cette formule :
Code:
="<td class=" & """td_image""" & "><a href=" & """" & DROITE(A1;CHERCHE("-";A1)-3) & ".html""" & "><img src=""../Blason_france/blason_alpha/" & DROITE(A1;CHERCHE("-";A1)-3)&"-" &GAUCHE(A1;2) & ".jpg""" & " width=""95"" height=""120""" & " ></a></td>"
 
Code:
<td class="td_image"><a href="ESCQ .html"><img src="../Blason_france/blason_alpha/ESCQ -40.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="LAND .html"><img src="../Blason_france/blason_alpha/LAND -74.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="OURG .html"><img src="../Blason_france/blason_alpha/OURG -87.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="AVAL .html"><img src="../Blason_france/blason_alpha/AVAL -87.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="OUVRE.html"><img src="../Blason_france/blason_alpha/OUVRE-16.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="ILLE .html"><img src="../Blason_france/blason_alpha/ILLE -78.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="GNET .html"><img src="../Blason_france/blason_alpha/GNET -03.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href=" RIVE.html"><img src="../Blason_france/blason_alpha/ RIVE-42.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="OMTE .html"><img src="../Blason_france/blason_alpha/OMTE -62.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="ANCHE.html"><img src="../Blason_france/blason_alpha/ANCHE-62.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="IERES.html"><img src="../Blason_france/blason_alpha/IERES-54.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="OURT .html"><img src="../Blason_france/blason_alpha/OURT -70.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="AGNY .html"><img src="../Blason_france/blason_alpha/AGNY -28.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="AGNY .html"><img src="../Blason_france/blason_alpha/AGNY -57.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="AGNY .html"><img src="../Blason_france/blason_alpha/AGNY -68.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="IGON .html"><img src="../Blason_france/blason_alpha/IGON -70.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="EXIN .html"><img src="../Blason_france/blason_alpha/EXIN -95.jpg" width="95" height="120" ></a></td>
<td class="td_image"><a href="OBERT.html"><img src="../Blason_france/blason_alpha/OBERT-70.jpg" width="95" height="120" ></a></td>
Bonjour Theze
La formule doit être bonne mais elle me marque que la moitié des noms de ville pourquoi?

@+
Max
 
Re,

Désolé, bourde de ma part. J'ai rajouté la fonction de suppression d'espaces car il y en a qui parasitent :
Code:
="<td class=" & """td_image""" & "><a href=" & """" & SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1))) & ".html""" & "><img src=""../Blason_france/blason_alpha/" & SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1))) &"-" &GAUCHE(A1;2) & ".jpg""" & " width=""95"" height=""120""" & " ></a></td>"
 
Bonjour,
Suite à la formules de theze que je remercie encore j'aimerai si possible ajouter un underscore entre chaque mot quand il est composé qui donnerai ceci "BAGE_LE_CHATEL-01"
Je vous remercie d'avance et vous souhaite une bonne soirée
Max
 
Bonjour à tous,

Peux-tu essayer :
Code:
="<td class=" & """td_image""" & "><a href=" & """" & SUBSTITUE(SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1)));" ";"_") 
& ".html"""& "><img src=""../Blason_France/blason_alpha/" & SUBSTITUE(SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1)));" ";"_")
&"-" &GAUCHE(A1;2) & ".jpg""" & " width=""95"" height=""120""" & " ></a></td>"

A+ à tous
 
Dernière édition:
Re,

Oui nickel je te remercie beaucoup.
Si je peut abusé de ton temps j'aimerai faire a peut prés la même chose "Formule" malgré avoir j'ai bien essayer mais chaque fois erreur.
Refaire toujours avec les même noms c'est à dire
56 068 - LA GREE SAINT LAURENT
56 195 - LA ROCHE BERNARD
56 257 - LA TRINITE PORHOET
56 258 - LA TRINITE SUR MER
56 259 - LA TRINITE SURZUR

Sortir avec <td class="td_text"> LA GREE SAINT LAURENT <br>- 56068 -</td>

Mercie et bonne journée

Max
 
Bonjour à tous,

Pas certain d'avoir compris :
Code:
="<td class=" & """td_image""" & "><a href=" & """" & SUBSTITUE(SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1)));" ";"_") 
& ".html""" & "><img src=""../Blason_France/blason_alpha/" & SUBSTITUE(SUPPRESPACE(DROITE(A1;NBCAR(A1)-CHERCHE("-";A1)));" ";"_")
&"-" &GAUCHE(A1;6)*1 & ".jpg""" & " width=""95"" height=""120""" & " ></a></td>"

A+ à tous
 
Re,

Non j'ai du mal m'expliquer avec ma liste des noms:

56 068 - LA GREE SAINT LAURENT
56 195 - LA ROCHE BERNARD
56 257 - LA TRINITE PORHOET
56 258 - LA TRINITE SUR MER
56 259 - LA TRINITE SURZUR

J'aimerai sortir comme ceci

<td class="td_text"> LA GREE SAINT LAURENT <br>- 56068 -</td>

@+

Max
 
Re,
Oui Nickel je te remercie beaucoup
Je voudrais te demander le 23 avril tu ma fait un code pour ajouter une ligne comme ceci:
Code:
Option Explicit

Sub LigneVide()
Dim DerL&, Lig&
DerL = Feuil1.Range("A" & Rows.Count).End(3).Row
For Lig = 1 To DerL
If Lig Mod 7 = 0 Then Rows(Lig).EntireRow.Insert
Next Lig
End Sub

Il fonctionne mais sur une colonne de environ 150 lignes il vas en prendre que 110 lignes une autre fois sur 200 lignes il vas prendre que 125 ect....

Peut tu me dire pourquoi?

Merci et bonne journée
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
22
Affichages
2 K
Retour