Inscrivez-vous gratuitementpour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter
Envoyé par patricktoulon Bonsoir regarde comment on applique le format tel que dans le html Pièce jointe 340937 Code : Sélectionner tout - Visualiser dans une fenêtre à part 12345678910Function html_transform_into_VBA(cel) With CreateObject("htmlfile") .body.innerhtml = cel.Value r = .parentwindow.clipboardData.setData("Text", "<table><tr><td>" & cel.Text & "</td></tr></table>") With cel.Parent: .Activate: cel.Select: .Paste: End With End With End Function Sub test() html_transform_into_VBA ActiveCell End Sub tout les format de font couleur bold italic underline exposant etc... seront restitués Bonjour, Ce code ne fonctionne pas avec Excel 2016. Cela tombe en erreur sur le paste. Que faudrait-il modifier ou préciser ? Cordialement Eric
Function html_transform_into_VBA(cel) With CreateObject("htmlfile") .body.innerhtml = cel.Value r = .parentwindow.clipboardData.setData("Text", "<table><tr><td>" & cel.Text & "</td></tr></table>") With cel.Parent: .Activate: cel.Select: .Paste: End With End With End Function Sub test() html_transform_into_VBA ActiveCell End Sub
Partager