参考:
- Sub 复制数据用()
- For X = 2 To Range("A65536").End(3).Row
- S = S & Cells(X, 1)
- Next
- Cells(1, 12) = Mid(S, 1, Len(S) - 1)
- End Sub
- Sub shishi3()
- Dim arr
- Dim cx As New 类1, pt$, f$, sql$, r&
- pt = ThisWorkbook.Path & "\数据收集"
- Application.ScreenUpdating = False
- [c2:g1000].ClearContents
- Cells(1, 12) = T
- sql = "select 姓名,部门,进厂时间,培训情况 from [sheet1$b1:f] where 工号 in ('" & [b2] & "','" & [b3] & "','" & [b4] & "','" & [b5] & "','" & [b6] & "','" & [b7] & "','" & [b8] & "','" & [b9] & "','" & [b10] & "','" & [b11] & "','" & [b12] & "','" & [b13] & "','" & [b14] & "','" & [b15] & "','" & [b16] & "','" & [b17] & "','" & [b18] & "')"
- f = Dir(pt & "*.xls*")
- Do While f <> ""
- r = Cells(65536, 3).End(3).Row + 1
- cx.mingling sql, pt & f, "c" & r
- f = Dir
- Loop
- Application.ScreenUpdating = True
- Cells(1, 12) = T
- End Sub
复制代码 |