Excel + Macro + Outlook

xxNeferpitouxx

New Member
Joined
Sep 28, 2017
Messages
6
Hello Guys!

2nd time posting in the forum :) My first question was promptly answered by one of us so very much positive that someone could again help me with my problem.

It's probably something basic but I don't have much knowledge about formulas so...

I'd like to include the person's name on the subject of the email.

Here's what the formula looks like:
.Subject = "QA Monitoring -" & " " & CCounter & "-" & "Period " & PeriodNum

I tried replacing CCounter with the cell value where the name was and of course, it didn't work. lol

With the above formula, this is what the Outlook Subject shows:
QA Monitoring - -Period 10

I wanted it to show this:
QA Monitoring - Person's Full Name - Period 10

Can you help?

Thanks again! :)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
First, being picky, but you don't need the &" "& you can just add the space after - in your first quote (same with - before period).

.Subject = "QA Monitoring - " & CCounter & "-Period " & PeriodNum

What did you replace CCounter with when you tried replacing with cell ref? Assuming its active workbook you should be able to replace CCounter with Range("A1")
 
Upvote 0
I've done something similar before.

I use a variable to get the name from the cell:

Dim PersonsName As Variant
PersonsName = ActiveCell.Value

Then input the variable into the subject line:

.Subject = "Evaluation - " & PersonsName & " - " & month
 
Upvote 0
I put the Range (I guess that's what it's called: C3) where the name is showing BUT I just realized that THAT cell is a formula (='Select Agent'!XFD3). lol So I guess that's why it didn't work?
 
Upvote 0
Let me try this and see if I'll be able to pull it off. Sorry but I wasn't trained in using Macros and all this stuff. I was just snooping around our forms to learn about this. Thanks! :) :) :)
 
Upvote 0
Whether the cell has formula or not shouldn't impact the macro.

.Subject = "QA Monitoring - " & Range("C3").value & "-Period " & PeriodNum

This should work.
 
Upvote 0
Crazydragon84 you guys are the best! It worked! Thanks much! :) :) :) If I have any more problems I'll be sure to drop by this forum. Thanks for being so helpful!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top