- ·上一篇:excel表格怎么根据数据求系数
- ·下一篇:excel表格不求和是怎么回事
excel表格怎么绑定链接
2024-09-20 15:44:23
1.excel 如何链接本文档中的图片
给个宏
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myPath As String, jpg As String, ss As String, NAM As String, RA As Range
ss = Target.Address
If ss = "$B$2" Or ss = "$B$300" Or ss = "$B$2" Or ss = "$B$300" _
Or ss = "$G$2" Or ss = "$G$300" Or ss = "$G$2" Or ss = "$G$300" Then
NAM = Target.Column & Target.Row
myPath = ThisWorkbook.Path &; "\照片库\"
jpg = Target.Value & ".jpg"
On Error Resume Next
Application.ScreenUpdating = False
Set RA = Target.Offset(0, 2)
With Sheets("格式")
RA.Select
.Pictures(NAM).Delete
.Pictures.Insert(myPath & jpg).Name = NAM
.Pictures(NAM).Height = RA.MergeArea.Height
.Pictures(NAM).Width = RA.Width
End With
Application.ScreenUpdating = True
End If
End Sub