Suppose
- the largefile large.csv
- the checkfile check.csv
- in path "E:\OF\"
- the reference number are the first 8 characters of each line in the check-file
- filtered data from the large file will be written into column P
Sub snb()
open "E:\OF\large.csv" for input as 1
sq=split(Input(LOF(1),1),vbcrlf)
close
open "E:\OF\check.csv" for input as 1
sn=split(Input(LOF(1),1),vbcrlf)
close
for j=0 to ubound(sn)
sn(j)=join(filter(sq,left(sn(j),8)),"")
next
cells(1,16).resize(ubound(sn)+1)=application.transpose(sn)
End Sub
Bookmarks