Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Lookup value

I am using Excel 2003. I have a worksheet with names and email addresses.
In this worksheet there are some people with the same name, so I need to be
able to do some sort of lookup on a name which produces all the possibilities
lets say name, identity number, email address which are selectable from a
list in a userform.

Ideally I need to be able to transfer the result from Excel into Word

Is this possible, if so, can someone assist me with some code, please?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Lookup value

See these links for a wealth of information:
http://word.mvps.org/FAQs/InterDev/XLToWordWithDAO.htm

http://word.mvps.org/faqs/interdev/c...wordfromxl.htm

http://word.mvps.org/FAQs/InterDev/C...XLFromWord.htm

Finally, and this is my personal favorite:

Add DocVariables to your Word document, wherever you want the Excel data to
go. For instance in Word click Insert Field DocVariable New Name (I
used First_Name in my example) OK. You will see a space reserved for the
variable. Tap Alt+F9 to display or hide the DocVariable. There are many,
many other methods, using bookmarks, etc. I think the DocVariable method is
the best for countless reasons (too many to go into here; try it you will see
the benefits of using this method).


Sub ControlWordFromXL()

Dim objWord As New Word.Application
Dim doc As Word.Document
Dim bkmk As Word.Bookmark
sWdFileName = Application.GetOpenFilename(, , , , False)
Set doc = objWord.Documents.Open(sWdFileName)
On Error Resume Next

Sheets("Sheet1").Activate
objWord.ActiveDocument.Variables("First_Name").Val ue =
Range("First_Name").Value
objWord.ActiveDocument.Variables("Last_Name").Valu e =
Range("Last_Name").Value
€˜etc€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦€¦.
objWord.ActiveDocument.Fields.Update

On Error Resume Next
objWord.Visible = True

End Sub


Regards,
Ryan--


Regards,
Ryan---
--
RyGuy


"Mark" wrote:

I am using Excel 2003. I have a worksheet with names and email addresses.
In this worksheet there are some people with the same name, so I need to be
able to do some sort of lookup on a name which produces all the possibilities
lets say name, identity number, email address which are selectable from a
list in a userform.

Ideally I need to be able to transfer the result from Excel into Word

Is this possible, if so, can someone assist me with some code, please?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Sumproduct - Condition based on lookup of a Lookup Hari Excel Discussion (Misc queries) 12 May 31st 06 09:28 AM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM


All times are GMT +1. The time now is 04:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"