Abdulkhadar
Board Regular
- Joined
- Nov 10, 2013
- Messages
- 165
- Office Version
- 2019
- 2010
- Platform
- Windows
Dear Excel Experts,
I want to operate both the VBs in button2.
Sub Prog_Button2_Click()
Dim i As Picture
Dim j As String
On Error Resume Next
If Target.Address = Range("c3").Address Then
ActiveSheet.Pictures.Delete
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
Sheets("Prog").PrintOut
End Sub
Sub Prog_Button3_Click()
Dim i As Picture
Dim j As String
On Error Resume Next
If Target.Address = Range("d4").Address Then
ActiveSheet.Pictures.Delete
j = "C:\Users\CSSHS CKD\Dropbox\Photo\" & Range("d4") & Value & ".jpg"
With Range("g8")
Set i = ActiveSheet.Pictures.Insert(j)
i.Height = 75
i.Weight = 70
i.Top = .Top
i.Left = .Left
i.Placement = xlMoveAndSize
End With
End If
End Sub
Thanks in advance.
I want to operate both the VBs in button2.
Sub Prog_Button2_Click()
Dim i As Picture
Dim j As String
On Error Resume Next
If Target.Address = Range("c3").Address Then
ActiveSheet.Pictures.Delete
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
Sheets("Prog").PrintOut
End Sub
Sub Prog_Button3_Click()
Dim i As Picture
Dim j As String
On Error Resume Next
If Target.Address = Range("d4").Address Then
ActiveSheet.Pictures.Delete
j = "C:\Users\CSSHS CKD\Dropbox\Photo\" & Range("d4") & Value & ".jpg"
With Range("g8")
Set i = ActiveSheet.Pictures.Insert(j)
i.Height = 75
i.Weight = 70
i.Top = .Top
i.Left = .Left
i.Placement = xlMoveAndSize
End With
End If
End Sub
Thanks in advance.