ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,738
- Office Version
- 2007
- Platform
- Windows
Eventing.
I have the code show below.
I need some some advice please for the correct code so when Yes is selected I am taken to a specific folder.
I can’t advise the path at present but stuck with the main code for when Yes is selected.
I have the code show below.
I need some some advice please for the correct code so when Yes is selected I am taken to a specific folder.
I can’t advise the path at present but stuck with the main code for when Yes is selected.
Code:
[COLOR=#000000]Private Sub Worksheet_Change(ByVal Target As Range)Dim shp As Shape[/COLOR]If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
If Target.Row Mod 20 = 0 Then Exit Sub
On Error GoTo son
For Each shp In ActiveSheet.Shapes
If shp.Type = msoPicture And shp.TopLeftCell.Address = Target.Offset(0, 1).Address Then shp.Delete
Next
If Target.Value <> "" And Dir("C:\Users\Ian\Desktop\SKYPE\LOCK PICK ME\" & "\" & Target.Value & ".jpg") = "" Then
'picture not there!
MsgBox "Photo " & Target.Value & " Doesn't exist" & vbCrLf & "Open The Picture Folder ?", vbCritical + vbYesNo, "No Photo Found"
Exit Sub
End If
ActiveSheet.Pictures.Insert("C:\Users\Ian\Desktop\SKYPE\LOCK PICK ME\" & "\" & Target.Value & ".jpg").Select
Selection.Top = Target.Offset(0, 1).Top + 5
Selection.Left = Target.Offset(0, 1).Left + 5
With Selection.ShapeRange
.LockAspectRatio = msoFalse
.Height = Target.Offset(0, 1).Height - 10
.Width = Target.Offset(0, 1).Width - 10
End With
Target.Offset(1, 0).Select
son:
[COLOR=#000000]End Sub[/COLOR]