View Single Post
 
Old 01-23-2020, 09:51 AM
ElHonigmann ElHonigmann is offline Windows 10 Office 2019
Novice
 
Join Date: Jan 2020
Posts: 1
ElHonigmann is on a distinguished road
Default Macro Help: Keep formatting

Hello,

with the help of some Youtube videos i was able to write a small excel macro to help me copying content from my excel table into a word document (by using bookmarks for example).
The macro works fine: it is able to copy the content from the excel sheet to the word document. The problem is: subscript- and superscript-numbers and -letters are turned into normal letters. IF possible i would like to change that.

This is the code is used:

Sub nachwordkopieren()

Dim Probenliste As Object
Dim appWord As Object

Set appWord = CreateObject("Word.Application")
Set Probenliste = appWord.Documents.Add("filepath")

appWord.Visible = True

Probenliste.Activate
Probenliste.Bookmarks("Probenname1").Range.Text = Range("Probenname1")
Probenliste.Bookmarks("Verbindung1").Range.Text = Range("Verbindung1")

Set Probenliste = Nothing
Set appWord = Nothing

End Sub


Keep in mind i am no expert^^
Any ideas are appreciated

Greetings!
Reply With Quote