您现在的位置是:首页 > 产经 >正文

excle表格两表格数据匹配(excel两表数据匹配)

发布时间:2022-08-26 15:51:24解羽才来源:

导读您好,蔡蔡就为大家解答关于excle表格两表格数据匹配,excel两表数据匹配相信很多小伙伴还不知道,现在让我们一起来看看吧!1、设表2为sheet2...

您好,蔡蔡就为大家解答关于excle表格两表格数据匹配,excel两表数据匹配相信很多小伙伴还不知道,现在让我们一起来看看吧!

1、设表2为sheet2,从第2行开始是数据,则1)插入模块。

2、做个自定义函数Function CString(strSN As String) As String Dim sht As Worksheet, R As Long, I As Long Set sht = Sheet2 With sht R = .Range("A"& Rows.Count).End(xlUp).Row For I = 2 To R If CStr(.Range("A"& I).Value) = strSN Then CString = CString & .Range("B"& I).Value &";"Next End With Set sht = NothingEnd Function2)表1中,C2=CString(A2),然后复制粘贴即可。

本文就讲到这里,希望大家会喜欢。

标签:

上一篇
下一篇

最新文章