A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi,
assuming that you want the picture
in sheet1 tab and in range (Target) A1:D10
- SaveAs your workbook with extension .xlsm (macros enabled)
- right click on sheet1 tab, select view code and paste in the following:
Private Sub Worksheet_Activate()
Set Target = Range("A1:D10") '<<< change target rangeOn Error Resume Next
Dim v As Variant
Dim p As Picture
Application.ScreenUpdating = False
For Each p In ActiveSheet.Pictures
If Not Intersect(p.TopLeftCell, Target) Is Nothing Then p.Delete
Next
v = "http://www.desicomments.com/wallpapers/force_of_nature/force_of_nature_33.jpg"
Set p = ActiveSheet.Pictures.Insert(v)
With p
.Height = Target.Height
.Width = Target.Width
.Top = Target.Top
.Left = Target.Left
End With
Application.ScreenUpdating = True
End Sub
- press Alt+Q to close Visual Basic