|
本帖最后由 wx486 于 2013-5-29 13:39 编辑
木鸭 发表于 2013-5-28 22:29 ![](static/image/common/back.gif)
准考证里面的信息除了考场和座位号没有,其它的都 有了。
昨晚已在另一个帖子里回复了,没有看?
Sub wx486()
Dim t As Table, ex As Object, i%, j%, sht, arr
Set ex = CreateObject("excel.application")
ex.workbooks.Open ActiveDocument.Path & "\考场安排.xlsx"
Set sht = ex.workbooks(1).sheets(1)
arr = sht.Range("a1").currentregion
For Each t In ActiveDocument.Tables
j = j + 1
For i = 1 To UBound(arr)
If VBA.Replace(t.Cell(1, 2).Range.Text, Chr(13) + Chr(7), "") = arr(i, UBound(arr, 2)) Then
t.Cell(9, 2).Range.Text = arr(i, 1)
t.Cell(9, 4).Range.Text = arr(i, 2)
End If
Next
Next
ex.workbooks(1).Close False
ex.Quit
Set ex = Nothing
MsgBox "OK,完成" & j & "个人员的录入!"
End Sub
Desktop.rar
(32.06 KB, 下载次数: 393)
|
评分
-
2
查看全部评分
-
|