[RESOLU] - VBA - MsgBox formatage du texte

PFG60

XLDnaute Junior
Bonjour à tous,

("Encore moi !... Oui je sais ça doit commencer à devenir énervant.")

Comment fait-on pour formater un texte dans une MsgBox ?
J'explique. Je souhaite faire en sorte qu'une partie de mon texte soit souligné.

Code:
MsgBox ("Dernière modification :" & Chr(10) & Chr(10) & Range("I1").Value), vbOKOnly + vbInformation, "Société - Dernière modification"

Je souhaite que le texte "Dernière modification :" soit souligné.
.
 
Dernière édition:

camarchepas

XLDnaute Barbatruc
Re : VBA - MsgBox formatage du texte

Bonsoir à tous,

Voici une solution dans une cellule de feuille :

Code:
Sub test()
Dim Mot As String
Dim NumCar As Long


Mot = "petit"
   Range("B3") = Range("B1")
   NumCar = InStr(1, Range("B3"), Mot)

   ' Si caractère spécial, le marquer
   If NumCar <> 0 Then
    Range("B3").Select
    With ActiveCell.Characters(Start:=NumCar, Length:=Len(Mot)).Font
     .FontStyle = "Gras"
     .Underline = xlUnderlineStyleSingle
    End With
   End If
End Sub
 

Pièces jointes

  • Test Ecriture.xlsm
    13.7 KB · Affichages: 71
Dernière édition:

Statistiques des forums

Discussions
312 088
Messages
2 085 199
Membres
102 816
dernier inscrit
bolivier