-
search excel from word and import results
I have approx. ten thousans copies of the same form to be filled out for the client. Four cells in the table on my form need to be changed on each copy. the data that is needed for one of the cells i must manually enter however the data for the other three of these cells in located in an excel spreadsheet. is there anyway to use VBA in my Word Form to automatically open the excel spreadsheet, use the data i entered manually in the first cell of my word table to search the excel spreadsheet for the corresponding values and import them back into the other three cells in my table in word?
for example:
my table in word
1. 215-AA-1234 (data entered manually)
2.
3.
4.
and the excel spreadsheet
1..A................B...................C........................D
8..215-AA........AC-9043.........Transmitter.........5423698
i want to write a VBA in word that can auto open the spread sheetin excel. Use the data "215-AA" from the table cell "1." to find the corresponding row "8" in the spreadsheet. take the values for B, C & D from that row in spreadsheet and fill them into the cells "2, 3, & 4" from the original word table.
i have eight staff members working on this manually and we are still falling behind, i am doing my best to automate and have made some progress but i think i am a bit out of my league with this problem...PLEASE Help 
here is the code i have so far in my word document to open my excel spreadsheet and it works fine. it is more the search and import/export part that is over my head. :
Sub OpenExcelWorkbook()
Dim objXLApplication As Excel.Application
Dim objXLWorkbook As Excel.Workbook
Set objXLApplication = CreateObject("Excel.Application")
Set objXLWorkbook = objXLApplication.Workbooks.Open("C:\Documents and Settings\Gsatterlee\Desktop\Unit 211& 212 Inst Index.xls")
objXLApplication.Visible = True
'........
'........
objXLWorkbook.Close
Set objXLWorkbook = Nothing
objXLApplication.Quit
Set objXLApplication = Nothing
End Sub
Similar Threads
-
Replies: 6
Last Post: 11-15-2006, 10:57 AM
-
Replies: 2
Last Post: 05-10-2006, 11:00 PM
-
By kseshagi in forum .NET
Replies: 2
Last Post: 03-14-2006, 11:47 PM
-
By Arun Goyal in forum Database
Replies: 3
Last Post: 03-02-2003, 09:01 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks