Y
yihong
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
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