How to populate word template from LOOKUP function from excel

If there a possibility to insert LOOKUP function to .TypeText section?

Now, I’ve created another cell which is basically lookup function created on A1 cell. And that is working 100%.

I want to remove that whole column of lookups, and incorporate it directly to code.

Idea: From cell A1, do lookup in another sheet and pull some value, and that value import in word through bookmark.


.GoTo What:=wdGoToBookmark, Name:=BOOKMARK8  
      .TypeText personList(i, 8)`

My Idea:

.GoTo What:=wdGoToBookmark, Name:=BOOKMARK8  
      .TypeText Text:= LOOKUP((i, 1),Sheet2!A:A,Sheet2!B:B)`


p.s just tell me if I was clear, otherwise I will attach .xls or full code!

Source: bookmarks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.