在B表的B2输入公式=VLOOKUP(A1,Sheet1!A:B,2,)下拉就可以了
Sub LKJL()
Set d = CreateObject("scripting.dictionary")
Set s1 = Sheets(1): Set s2 = Sheets(2)
For i = 1 To s1.[a65536].End(3).Row
d(s1.Cells(i, 1).Value) = s1.Cells(i, 2)
Next
For j = 1 To s2.[a65536].End(3).Row
If d.exists(s2.Cells(j, 1).Value) Then
s2.Cells(j, 2) = d(s2.Cells(j, 1).Value)
End If
Next
Set d = Nothing
End Sub
追问这个代码没有看懂。我现在的问题是。有Sheet1表(需要翻译的表)与Sheet2表(什么翻译都有的),我需要在Sheet1表中找到与Sheet2表中英文(不区分大小写)相同的,将Sheet2列表中对应的列翻译拷到Sheet1表中需要翻译的列表中
追答Sub LKJL()
Set d = CreateObject("scripting.dictionary")
Set s2 = Sheets(1): Set s1 = Sheets(2)
For i = 1 To s1.[a65536].End(3).Row
uc = UCase(s1.Cells(i, 1).Value)
d(uc) = s1.Cells(i, 2)
Next
For j = 1 To s2.[a65536].End(3).Row
mc = UCase(s2.Cells(j, 1).Value)
If d.exists(mc) Then
s2.Cells(j, 2) = d(mc)
End If
Next
Set d = Nothing
End Sub