|
- Sub lqxs()
- Dim Arr, i&, wz, myPath$, myName$, j%
- Dim rng As Range, ML, MT, MW, MH
- Dim d, k
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- myPath = ThisWorkbook.Path & "\员工身份证照片"
- myName = Dir(myPath & "*.jpg")
- Do While myName <> ""
- d(myName) = ""
- myName = Dir
- Loop
- k = d.keys
- wz = Array("d2", "h2", "i5", "n2", "d3", "h3", "n3", "d4", "h4", "n4", "d5")
- Sheet2.Activate
- Arr = [b5].CurrentRegion
- For i = 2 To UBound(Arr)
- Sheet1.Copy after:=Sheets(Sheets.Count)
- With ActiveSheet
- .Name = Arr(i, 1)
- For j = 0 To UBound(wz)
- .Range(wz(j)) = Arr(i, j + 1)
- Next
- If d.exists(Arr(i, 3) & ".jpg") Then
- Set rng = .[q2:q5]
- With rng
- ML = .Left + 1
- MT = .Top + 1
- MW = .Width - 2
- MH = .Height - 2
- ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
- Selection.ShapeRange.Fill.UserPicture myPath & Arr(i, 3) & ".jpg"
- Selection.ShapeRange.Line.Visible = msoFalse
- End With
- End If
- If d.exists(Arr(i, 3) & "all.jpg") Then
- Set rng = .[c14:h27]
- With rng
- ML = .Left
- MT = .Top
- MW = .Width
- MH = .Height
- ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
- Selection.ShapeRange.Fill.UserPicture myPath & Arr(i, 3) & "all.jpg"
- Selection.ShapeRange.Line.Visible = msoFalse
- End With
- End If
- End With
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|