|
Sub limont()
Dim Arr As Variant, i%, Cn As Object, StrSQL$
i = Application.Match("周" & Mid([F5], 3), Sheet3.Range("A:A"), 0)
Arr = Intersect(Sheet3.UsedRange, Sheet3.Range(Sheet3.Cells(i, 2), Sheet3.Cells(i, 19)))
Set Cn = CreateObject("Adodb.Connection")
Cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0;Data Source=" & ThisWorkbook.FullName
StrSQL = "Select * From [客户信息$] Where 所属路线 in('" & Replace(RTrim(Join(Application.Transpose(Application.Transpose(Arr)))), " ", "','") & "')"
Range("B8").CopyFromRecordset Cn.Execute(StrSQL)
End Sub |
评分
-
1
查看全部评分
-
|