没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Sub jpg()
Dim wj, wj2, wj3 As String
Dim rng As Range
dim colSku,colImg as long
colSku=4 '设置sku列
colImg=5 '设置图片列
Application.ScreenUpdating = False
ThisWorkbook.Activate
x = [a65536].End(xlUp).Row '取得最后一行的行号
For i = 2 To x
na = Trim(Cells(i, colSku))
wj = "Z:\800X800PNG" & "\" & na & ".png"
wj2 = "Z:\Reebonz\800X800" & "\" & na & ".jpg"
wj3 = "Z:\Reebonz\800X800全图" & "\" & na & ".jpg"
If IsFileExists(wj) =True Then
Cells(i, colImg).Select
ActiveSheet.Shapes.AddPicture(wj, False, True, 1, 1, -1, -1).Select
Set rng = Cells(i, colImg)
With Selection
.Top = rng.Top + 1
.Left = rng.Left + 1
.Width = rng.Width - 1
.Height = rng.Height - 1
End With
ElseIf IsFileExists(wj2) =True Then
Cells(i, colImg).Select
ActiveSheet.Shapes.AddPicture(wj2, False, True, 1, 1, -1, -1).Select
Set rng = Cells(i, colImg)
With Selection
Dim wj, wj2, wj3 As String
Dim rng As Range
dim colSku,colImg as long
colSku=4 '设置sku列
colImg=5 '设置图片列
Application.ScreenUpdating = False
ThisWorkbook.Activate
x = [a65536].End(xlUp).Row '取得最后一行的行号
For i = 2 To x
na = Trim(Cells(i, colSku))
wj = "Z:\800X800PNG" & "\" & na & ".png"
wj2 = "Z:\Reebonz\800X800" & "\" & na & ".jpg"
wj3 = "Z:\Reebonz\800X800全图" & "\" & na & ".jpg"
If IsFileExists(wj) =True Then
Cells(i, colImg).Select
ActiveSheet.Shapes.AddPicture(wj, False, True, 1, 1, -1, -1).Select
Set rng = Cells(i, colImg)
With Selection
.Top = rng.Top + 1
.Left = rng.Left + 1
.Width = rng.Width - 1
.Height = rng.Height - 1
End With
ElseIf IsFileExists(wj2) =True Then
Cells(i, colImg).Select
ActiveSheet.Shapes.AddPicture(wj2, False, True, 1, 1, -1, -1).Select
Set rng = Cells(i, colImg)
With Selection
资源评论
Geldof-Guo
- 粉丝: 10
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功