Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
nquzaza nquzaza is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
Why can't I get Multiple instances of word? Laverne Microsoft Word Help 14 November 17th 06 01:35 PM
Change paper size; Word changes to invalid margins OhioTech New Users 10 July 6th 06 02:00 PM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM


All times are GMT +1. The time now is 01:38 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"