Just spotted typo, should be
Option Explicit
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Address = "$D$5" Then
Select Case Sh.Name
Case "A", "B", "C" '<list sheets for signing here
AddSignature
Case Else: Exit Sub
End Select
End If
End Sub
Check your add signature because the variable names do not match your declared names
Option Explicit
Sub AddSignature()
Dim ws As Worksheet
Dim rRng As Range
Dim Signatory As String
Dim Search_Str As String
' Dim OutApp As Object
' Dim OutMail As Object
'paste letter signatory
Signatory = ActiveCell.Value
Set ws = ActiveSheet
ws.DrawingObjects.Delete
Search_Str = "Yours sincerely"
Set rRng = ws.Columns(1).Find(Search_Str, LookIn:=xlValues)
If Not rRng Is Nothing Then
'Search_Str found insert picture according to where found then move down accordingly
InsertPic "T:\Scheme Details\Signatures\" & Signatory & ".JPG", _
ws.Range(rRng.Address), False, True
Else
'no instances of Search_Str
MsgBox "Unable to locate salutation on the '" & ws.Name & "' worksheet." & Chr(13) & Chr(13) & "As a result no signature has been inserted within this worksheet.", vbOKOnly + vbInformation, "NO SALUTATION FOUND"
End If
End Sub
Bookmarks