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

My problem is simple, but the explanation isnt that much...

I have a document called base.xls, and its composed of two columns. Column A
is the string key, and column B is the string translation.

Now i have a series of other documents that are composed of several columns,
but then again columna A is the string key, and column D is the string
translation.

What i need to do is to create a routine at base.xls that can be used to
compare column A from both documents, and if they match, put on the D cell
of the second kind of document the text that is in the B cell of base.xls

Also, i need to be able to change what document im comparing, because i have
like 5 or 6 of the type 2 documents every week, and all need the string
translation .

Could anyone help me?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Document merging

Hi Remo,

Try this macro:

Sub StrKeyFill()
sectypewb = InputBox("Please, enter the path and name of the second type
workbook (without extension)!")
Workbooks.Open Filename:=sectypewb & ".xls"
lastrow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
Range("D2").Select
ActiveCell.FormulaR1C1 =
"=VLOOKUP(RC[-3],[base.xls]Sheet1!R2C1:R5C2,2,FALSE)"
Selection.AutoFill Destination:=Range("D2:D" & lastrow),
Type:=xlFillDefault
End Sub


It basically does the job, though it can be further refined, e.g. to check
the existence of the second type file, etc.

Regards,
Stefi

€˛Remo Turchetti€¯ ezt Ć*rta:

My problem is simple, but the explanation isnt that much...

I have a document called base.xls, and its composed of two columns. Column A
is the string key, and column B is the string translation.

Now i have a series of other documents that are composed of several columns,
but then again columna A is the string key, and column D is the string
translation.

What i need to do is to create a routine at base.xls that can be used to
compare column A from both documents, and if they match, put on the D cell
of the second kind of document the text that is in the B cell of base.xls

Also, i need to be able to change what document im comparing, because i have
like 5 or 6 of the type 2 documents every week, and all need the string
translation .

Could anyone help me?

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
Merging into a Word document Nancy Volunteer Secretary for non-profit Excel Discussion (Misc queries) 0 September 5th 09 03:43 PM
Merging the Changes from One Excel Document into another jwags[_2_] Excel Discussion (Misc queries) 9 August 3rd 09 06:06 PM
Merging cell data into a document? aly259 Excel Discussion (Misc queries) 1 July 13th 09 10:40 PM
Document merging function Sheeloo Excel Discussion (Misc queries) 1 June 9th 09 04:11 AM
Merging Document Help DeperateNumbers Excel Worksheet Functions 3 September 24th 07 11:11 PM


All times are GMT +1. The time now is 02:42 AM.

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

About Us

"It's about Microsoft Excel"