EXCEL – A列有554个SKU,B列有1872个。不是没有。 我怎样才能得到他们匹配的数据第一次?

我有超过100个供应商列表,我需要sorting和调整软件系统迁移。 如果有人知道这个答案,我将不胜感激任何意见。 我试过= VLOOKUP,=匹配。 我无法弄清楚如何使用匹配的SKU首先组织数据。

这是列表看起来像的一个例子。

#105:CR1910-RT10G0 #105:GR1019-SL54FT #105:CR1910-RT10M0 #105:GR1035-SL54F0 #105:GL1405-M078F0 #105:GR1035-SL54H0 #105:GL1407-0306C0 #105:GR1035-SL54P0 #105:GL1409-0306C0 #105:GR1019-SL54FT #105:GL1409-0312C0 #105:GR1730-SL54P0 #105:GL1409-BR16C0 #105:GR1838-SL54H0 #105:GL1409-CL12C0 #105:GR1471-SL54P0 #105:GL1409-STGRCF #105:MB2172-SL54H0 #105:GL1412-0306C0 #105:MB2172-SL34H0 #105:GL1413-0306C0 #105:MB2172-SL54P0 #105:GL1428-0306C0 #105:MB2172-SL34P0 #105:GL1428-0306F0 #105:MB1810-SL34P0 #105:GL1428-0312C0 #105:MB1779-SL54P0 #105:GL1428-M078F1 #105:GR1768-SL54H0 #105:GL1428-ML12C0 #105:MB1809-SL54H0 #105:GL1428-STGRCF #105:MB1809-SL34H0 #105:GL1430-BRICF0 #105:MB1809-SL54P0 #105:GL1512-0208C0 #105:MB1809-SL34P0 #105:GL1512-0306C0 #105:GR1234-SL54P0 #105:GL1512-0306F0 #105:GR1879-SL54P0 #105:GL1512-0312C0 #105:GR1879-SL54V0 #105:GL1512-0312F0 #105:MB2053-SL54P0 #105:GL1512-BR16C0 #105:MB1806-SL54H0 

移动你的第二列到另一列,我用列C.

然后在新的第二列使用这个公式:

 =IFERROR(VLOOKUP(C1,A:A,1,FALSE),"") 

在这里输入图像说明

然后在新的第二列上对新的第二列和旧的第二列进行sorting。

![在这里输入图片描述

此时,您可以隐藏列A或复制并粘贴列B中的值并删除列A.


在VBA中这样做:

 Sub MySort() Dim ws As Worksheet Dim rng As Range Dim t As Long Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Application.EnableEvents = False Set ws = ThisWorkbook.Worksheets("Sheet17") 'Change to your sheet With ws .[B:B].Insert For Each rng In .Range(.Cells(1, 3), .Cells(.Rows.Count, 3).End(xlUp)) t = 0 On Error Resume Next t = Application.WorksheetFunction.Match(rng, .Range("A:A"), 0) On Error GoTo 0 If t > 0 Then rng.Offset(, -1).Value = rng.Value Next rng .Range("A:A").Delete .Range("A:B").Sort Key1:=.Range("A1") End With Application.ScreenUpdating = True Application.Calculation = xlAutomatic Application.EnableEvents = True End Sub