Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dear friends, I try to combine data between two worksheet using VB. One workbook calls SAN kept in c:\test\import, another workbook calls WYE kept in c:\test\backup SAN Workbook has one sheet (sheet1) COLUMN A B C034001 C042001 C054021 WYE Workbook has one sheet(code) column A B C034001 WYE1 C042001 WYE2 C054021 WYE3 Now want to use vb code to copy WYE column B value to SAN column B based on the column A. But always failed. Could anybody help me. Thanks so much My current some code as below set backxl=new excel.application set destxl=new excel.applicaiton strDestF=C:\test\import\san.xls strBackF=c:\test\backup\wye.xls destXL.Workbooks.Open strDestF backXL.Workbooks.Open strBackF i=0 I try to use vlookup to get value from wye.xls to san.xls, but failed destXL.Cell(i + 2, 2) = "vlookup('" & destXL.Cells(i + 2, 1) & "'," & "[strBackF]Code!A$A$2" & ":" & "$B$4" & ",2)" Regards -- yihong ------------------------------------------------------------------------ yihong's Profile: http://www.excelforum.com/member.php...o&userid=25018 View this thread: http://www.excelforum.com/showthread...hreadid=385473 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need VBA Code to Let User Define Active Sheet | Excel Discussion (Misc queries) | |||
Looking for code to define a range | Excel Discussion (Misc queries) | |||
Delete Define names across workbook | Excel Worksheet Functions | |||
How do I define a macro that will generate VBA code? | Excel Programming | |||
VBA code to define nbr of text character a a cell/column | Excel Programming |