On est nuls en chimie quand-même ...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub UserForm_Initialize() Const FName As String = "C:\Image.gif" Dim Cellule As Range Dim Feuille As Worksheet Dim ChartTemp As Chart Dim PicTemp As Picture Dim I As Long Set Cellule = ActiveSheet.Range("A4") 'Cellule où on écrit la formule Cellule.Value = "C4H10N2B" For I = 1 To Len(Cellule) If IsNumeric(Mid(Cellule, I, 1)) Then Cellule.Characters(Start:=I, Length:=1).Font.Subscript = True End If Next Application.ScreenUpdating = False Set Feuille = Worksheets.Add Charts.Add ActiveChart.Location xlLocationAsObject, Feuille.Name Set ChartTemp = ActiveChart Cellule.CopyPicture Appearance:=xlScreen, Format:=xlPicture ChartTemp.Paste Set PicTemp = Selection ' je n'aime pas, mais bon... ChartTemp.Export FName, "gif" UserForm1.Image1.Picture = LoadPicture(FName) UserForm1.Image1.Width = Selection.Width UserForm1.Image1.Height = Selection.Height Kill FName Application.DisplayAlerts = False Feuille.Delete Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub