anoctuawes
New Member
- Joined
- Sep 15, 2021
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hi all,
I've been googling for hours on end and can't see to find a solution that works.
I have a macro that saves and send an email and I want the subject line to include data from one of the worksheets within the book.
This is what I have currently, but when executed the area no data is returned:
With OutMail
.To = "email.com"
.CC = ""
.BCC = ""
.Subject = "Spreadsheet for " & Worksheet("Risk Assessment (S1)").Range("C8:I8").Value
"Spreadsheet for " is the text
Risk Assessment (S1) is the name of the tab the cell is contained within
The cell contains text - I have also tried ".text" but this returns blank too.
I thought perhaps I should be calling it "Sheet1" instead of the name of the tab, but Sheet1 does not work
I read different suggestions of "Worksheet" vs "Worksheets" and tried both, but neither worked.
I tried referencing just the first cell (it is a merged cell), so that being C8, and this did not work
I am not getting any errors, the subject simply keeps displaying as, "Spreadsheet for "
What am I doing wrong?
I've been googling for hours on end and can't see to find a solution that works.
I have a macro that saves and send an email and I want the subject line to include data from one of the worksheets within the book.
This is what I have currently, but when executed the area no data is returned:
With OutMail
.To = "email.com"
.CC = ""
.BCC = ""
.Subject = "Spreadsheet for " & Worksheet("Risk Assessment (S1)").Range("C8:I8").Value
"Spreadsheet for " is the text
Risk Assessment (S1) is the name of the tab the cell is contained within
The cell contains text - I have also tried ".text" but this returns blank too.
I thought perhaps I should be calling it "Sheet1" instead of the name of the tab, but Sheet1 does not work
I read different suggestions of "Worksheet" vs "Worksheets" and tried both, but neither worked.
I tried referencing just the first cell (it is a merged cell), so that being C8, and this did not work
I am not getting any errors, the subject simply keeps displaying as, "Spreadsheet for "
What am I doing wrong?