kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello All,
How do I make this code respond to cells with formulasome instead of the Target?
I am running into some troubles and wish there is a way to use cells with formulas instead of direct changing from the cells.
Thanks
How do I make this code respond to cells with formulasome instead of the Target?
I am running into some troubles and wish there is a way to use cells with formulas instead of direct changing from the cells.
Thanks
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim fPath As String, sFile$
If Target = Me.[h9] Then
fPath = ThisWorkbook.Path & "" & Me.CmbTerm.Text
sFile = Dir(fPath & "" & Right(Me.[h9].Text, 3) & ".*")
If sFile <> vbNullString Then
Me.Image1.Picture = LoadPicture(fPath & "" & sFile)
Else
Me.Image1.Picture = LoadPicture("")
End If
If Err.Number = 53 Then Me.Image1.Picture = LoadPicture("")
End If
End Sub