Good morning everyone,
Still getting to grips with VBA (sites like this are SO helpful) but this one has me stumped, even after much searching.
I've set up a VBA to export my whole Excel worksheet into a Word template, like so:
However, I'd like to take the text in cell B1 and add it to the file's header, where I've set the "Title" bookmark. I've seen a few different ways of doing this but none that I've managed to successfully integrate into my code above. Any ideas? Thank you in advance!
Still getting to grips with VBA (sites like this are SO helpful) but this one has me stumped, even after much searching.
I've set up a VBA to export my whole Excel worksheet into a Word template, like so:
VBA Code:
Private Sub Create_Click()
Sheet31.Select
a = Sheet31.UsedRange.Rows.Count
Set obj = CreateObject("Word.Application")
Set wd = CreateObject("Word.Application")
obj.Visible = True
Set newObj = obj.Documents.Add("xxxx\Template.dotx")
ActiveSheet.UsedRange.Copy
newObj.Range.Paste
Application.CutCopyMode = False
obj.Activate
End Sub
However, I'd like to take the text in cell B1 and add it to the file's header, where I've set the "Title" bookmark. I've seen a few different ways of doing this but none that I've managed to successfully integrate into my code above. Any ideas? Thank you in advance!