|
Private Sub CommandButton3_Click()
Call 删除批注
'批注插图按钮
On Error Resume Next
'Set obj = Application.FileDialog(msoFileDialogFolderPicker)
'
'With obj
'
'If .Show = -1 Then
'
'spath = .SelectedItems(1)
'
'End If
'
'
'
'End With
If Len([n1]) = 0 Then Exit Sub
spath = [n1]
row_b = 3 '代表从第3行开始,Val(InputBox("请输入序号启始行号,如第1行输 1"))
row_e = Cells(Rows.Count, 4).End(3).Row '代表最下一行,Val(InputBox("请输入序号结束行号,如第10行输 10"))
col_ = 4 '索引编号或图片名称所在列号,Val(InputBox("请输入序号所在的列号,如第1列输 1"))
pcol_ = 4 '把图片插入到第几列中的列号,Val(InputBox("请输入要图片所在的列号,如第2列输 2"))
For i = row_b To row_e
Cells(i, pcol_).AddComment
Cells(i, pcol_).Comment.Shape.Fill.UserPicture (spath & "\" & Cells(i, col_).Value & ".jpg")
Cells(i, pcol_).Comment.Shape.Height = 100
Cells(i, pcol_).Comment.Shape.Width = 100
Cells(i, pcol_).Comment.Visible = False
Next
End Sub |
|