Tablecloth98
New Member
- Joined
- Nov 15, 2023
- Messages
- 24
- Office Version
- 2021
- Platform
- Windows
I need to use an if statement to add an attachment to an email if cell G5 contains specific text (e.g. "Specific Text").
I've tried using
If Range("G5").Value = "Specific Text" Then
.Attachment.Add "C:\Documents\MadeUpFileLocation\ImageName.JPG"
End If
but the debug is highlighting the attachment line.
Am I doing something wrong? (Apologies if this is a silly question. I'm very new to vba)
I've tried using
If Range("G5").Value = "Specific Text" Then
.Attachment.Add "C:\Documents\MadeUpFileLocation\ImageName.JPG"
End If
but the debug is highlighting the attachment line.
Am I doing something wrong? (Apologies if this is a silly question. I'm very new to vba)