If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Vlookup in Word?
I want to make a drop down box in a word document with a list of Company
names and when a company name is selected, the fax number is displayed in the next cell (the way you would use the Vlookup function in Excel) so that the company name appears in one cell and the fax number in the cell next to it. Any help would be greatly appreciated. |
#2
|
|||
|
|||
Vlookup in Word?
Create an autotext entry with the name of the company that contains the fax
number for each company. Then have a macro containing the following code run on exit from the Drop Down FormField containing the company names. The code assumes that Drop Down FormField has the bookmark name of ddCompany and that there is a text FormField with the bookmark name of txtFax that will display the fax number. ' Macro created 15-11-97 by Doug Robbins to add the address corresponding to a drop down name ' Dim cmbCompany As DropDown Dim Company As String Dim Fax As String Set cmbCompany = ActiveDocument.FormFields("ddCompany").DropDown Company = cmbCompany.ListEntries(cmbCompany.Value).Name Fax = ActiveDocument.AttachedTemplate.AutoTextEntries(Co mpany).Value ActiveDocument.FormFields("txtFax").Result = Fax -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "nquzaza" wrote in message ... I want to make a drop down box in a word document with a list of Company names and when a company name is selected, the fax number is displayed in the next cell (the way you would use the Vlookup function in Excel) so that the company name appears in one cell and the fax number in the cell next to it. Any help would be greatly appreciated. |
Thread Tools | |
Display Modes | |
|
|