admin管理员组

文章数量:1122847

vba,excel,身份证,照片

Sub 插入图片()    '调整单元格大小,以适应图片大小 功能 插入身份证照片打印 - 正面在单元格d6       反面单元格d10
 ActiveSheet.Pictures.Delete '清理过期照片
Range("d6").Select
Dim aa
aa = ActiveSheet.Range("j1").Value '激活表的 J1的值 =照片(正)路径
ActiveSheet.Pictures.Insert(aa).Select   
Dim sh As ShapeFor Each sh In ActiveSheet.Shapessh.LockAspectRatio = Falsesh.Left = sh.TopLeftCell.Leftsh.Top = sh.TopLeftCell.Topsh.Width = sh.TopLeftCell.Widthsh.Height = sh.TopLeftCell.HeightNext shCall chaEnd Sub
Sub cha()
Range("d10").SelectDim aa
aa = ActiveSheet.Range("j2").Value '激活表的 J2的值=照片(反)路径ActiveSheet.Pictures.Insert(aa).Select        '当前文件所在目录下以单元内容为名称的.jpg图片
Dim sh As ShapeFor Each sh In ActiveSheet.Shapessh.LockAspectRatio = Falsesh.Left = sh.TopLeftCell.Leftsh.Top = sh.TopLeftCell.Topsh.Width = sh.TopLeftCell.Widthsh.Height = sh.TopLeftCell.HeightNext shEnd Sub

功能 插入身份证照片打印 - 正面在单元格d6       反面单元格d10

 

转载于:.html

本文标签: VBAEXCEL身份证照片