|
Sub 批量插图()
off = Application.Version
Dim ff
mp = ThisWorkbook.Path & "\移入\"
If Dir(mp, vbDirectory) = "" Then MkDir (mp)
tr = ActiveCell.Row: tc = ActiveCell.Column
FILETOOPEN = Application.GetOpenFilename("JPG Files (*.JPG), *.JPG", , , , True)
For Each ff In FILETOOPEN
fff = Split(ff, "\")(UBound(Split(ff, "\")))
FileCopy ff, mp & fff
Cells(tr, tc).Select
If Application.Version <> "11.0" Then
ActiveSheet.Pictures.Insert(ff).Cut
Cells(tr, tc).Select
ActiveSheet.PasteSpecial Format:="图片 (JPEG)"
Else
ActiveSheet.Pictures.Insert(ff).Select
End If
Cells(tr + 14, tc) = ff1
tc = tc + 60
If tc = 182 Then
tr = tr + 14
tc = 2
End If
Next ff
Application.CommandBars("Picture").Visible = False
End Sub
|
|