Abdulkhadar
Board Regular
- Joined
- Nov 10, 2013
- Messages
- 165
- Office Version
- 2019
- 2010
- Platform
- Windows
Dear Excel Experts.
When press the button delete the K25 cell image and replace as per C3 cell
or when change the name of target cell C3 replace the picture at k25.
Sub Prog_Button2_Click()
Dim i As Picture
Dim j As String
Sheet54.Unprotect Password:="123456"
On Error Resume Next
If Target.Address = Range("c3").Address Then
ActiveSheet.Pictures.Delete ' here i want to delete already saved picture at K25 cell to replace another without effecting other pictures in this sheet
j = "C:\Users\CSSHS CKD\Dropbox\Photo\" & Range("c3") & Value & ".jpg"
With Range("k25")
Set i = ActiveSheet.Pictures.Insert(j)
i.Height = 100
i.Weight = 95
i.Top = .Top
i.Left = .Left
i.Placement = xlMoveAndSize
End With
End If
Sheet54.Protect Password:="123456"
End Sub
Thanks with regards
When press the button delete the K25 cell image and replace as per C3 cell
or when change the name of target cell C3 replace the picture at k25.
Sub Prog_Button2_Click()
Dim i As Picture
Dim j As String
Sheet54.Unprotect Password:="123456"
On Error Resume Next
If Target.Address = Range("c3").Address Then
ActiveSheet.Pictures.Delete ' here i want to delete already saved picture at K25 cell to replace another without effecting other pictures in this sheet
j = "C:\Users\CSSHS CKD\Dropbox\Photo\" & Range("c3") & Value & ".jpg"
With Range("k25")
Set i = ActiveSheet.Pictures.Insert(j)
i.Height = 100
i.Weight = 95
i.Top = .Top
i.Left = .Left
i.Placement = xlMoveAndSize
End With
End If
Sheet54.Protect Password:="123456"
End Sub
Thanks with regards