J
Jaquot
Guest
Bonsoir le forum
Je voudrais concaténer des cellules et conserver la couleur de la police .
Pour cela étant néophyte en vba j'ai bidouillé une macro mais je n'arrive pas à la creer en fonction personnaliséé.
Si une ame charitable passe par là,soyez indulgent !!
Merci d'avance
ps:je n'arive pas à envoyer en pièce jointe voici le code
Sub ConcaténerAvecCouleur()
Range("b7").Select
LongueurTexte = Len(Range("B7"))
COULEUR = Selection.Font.ColorIndex
Range("d7").Select
ActiveCell.FormulaR1C1 = "=+RC[-2]&RC[-1]"
Range("c7").Select
LongueurTexte2 = Len(Range("c7"))
COULEUR1 = Selection.Font.ColorIndex
Range("d7").Select
ActiveCell.FormulaR1C1 = (Range("d7").Value)
With ActiveCell.Characters(Start:=1, Length:=LongueurTexte).Font
.ColorIndex = COULEUR
End With
With ActiveCell.Characters(Start:=LongueurTexte + 1, Length:=LongueurTexte2).Font
.ColorIndex = COULEUR1
End With
End Sub
Je voudrais concaténer des cellules et conserver la couleur de la police .
Pour cela étant néophyte en vba j'ai bidouillé une macro mais je n'arrive pas à la creer en fonction personnaliséé.
Si une ame charitable passe par là,soyez indulgent !!
Merci d'avance
ps:je n'arive pas à envoyer en pièce jointe voici le code
Sub ConcaténerAvecCouleur()
Range("b7").Select
LongueurTexte = Len(Range("B7"))
COULEUR = Selection.Font.ColorIndex
Range("d7").Select
ActiveCell.FormulaR1C1 = "=+RC[-2]&RC[-1]"
Range("c7").Select
LongueurTexte2 = Len(Range("c7"))
COULEUR1 = Selection.Font.ColorIndex
Range("d7").Select
ActiveCell.FormulaR1C1 = (Range("d7").Value)
With ActiveCell.Characters(Start:=1, Length:=LongueurTexte).Font
.ColorIndex = COULEUR
End With
With ActiveCell.Characters(Start:=LongueurTexte + 1, Length:=LongueurTexte2).Font
.ColorIndex = COULEUR1
End With
End Sub