+ Reply to Thread
Results 1 to 13 of 13

Copy offset cell value to email subject line

  1. #1
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Copy offset cell value to email subject line

    I am trying to write some vba language that will look in column AE for the word "True"

    If it is found then it would select the cell in the same row from column A, which would be a person's name,

    and use that name in the subject line of an email.

    If it makes any difference, the word "True" is inserted by the program if the cell in AD is greater than 1

    I have tried every combination I can think of and I cannot figure it out.

    Any ideas would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    is "True" the complete cell or does it contain other words "blah blah true", "true blah blah"
    are you looking for "True" multiple times within column AE?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    The value in column AE can only be True or False.

    The value would only change from False to True when an employee reports their beginning and ending time for the day and the calculation is made. After the email is sent, the cell will be cleared and thusly the rest of the column will be False until the next calculation is made.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    Here is a rough outline you can work around

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    Please Login or Register  to view this content.
    [/CODE]
    Last edited by timlh42; 05-01-2017 at 09:42 AM.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    get the employee name if column A in the same row as the True to attach to my subject line in my email
    are you wanting to have a new email per employee or have multiple employees on the same email?

    also you seem to missing a whole big chunk of code around your email?

  7. #7
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    are you wanting to have a new email per employee or have multiple employees on the same email?

    also you seem to missing a whole big chunk of code around your email?[/QUOTE]

    It generates a new email each time an employee exceeds a certain time.

    The email generates fine but I cannot get the employee name in column A

    to display in the subject line.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    please change your post #5 to use [code] tag

  9. #9
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    Sorry. I have it changed now. Hopeful I did it right.

  10. #10
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    Any further help would be greatly appreciated

  11. #11
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    So looking at your code i am assuming your using CDO from Ron's Page (Link provided in code)
    there is additional information you need to fill in like

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-26-2017
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Re: Copy offset cell value to email subject line

    This is what I have so far. The email sends fine every time but I just can't get the driver's name from column A to show up in the subject line. I thought maybe it had something to do with "True" being calculated instead of input.

    Please Login or Register  to view this content.



    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Last edited by timlh42; 05-01-2017 at 09:43 AM.

  13. #13
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy offset cell value to email subject line

    you are getting yourself in a hot mess jumping from subroutine to subrountine which overlap in what they do

    Please Login or Register  to view this content.
    if you already have code that checks if cell is true then you actually dont need an additional loop to do the same thing
    it would seem like your just patching together various code and hoping they all meld and kind of work

    please debug your code using break points
    http://www.excel-easy.com/vba/examples/debugging.html
    its very simple and its a very important skill to learn in coding

    if you do this you will find out very quickly what your code is doing and why its not doing what you want it do be doing

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-18-2015, 05:35 PM
  2. Cant put correct cell as subject line in email
    By kwik98 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-15-2014, 03:22 PM
  3. creating a macro to use cell content as subject line in sending email - protected sheet
    By John Eathorne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2013, 05:06 PM
  4. Macro Automate Email Subject Line Based on Cell Value
    By richzipday in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2013, 06:33 PM
  5. Add cell value to email subject line
    By shariq1989 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-02-2012, 01:28 PM
  6. Tab Name in Email Subject Line
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-20-2010, 02:37 PM
  7. Value of a cell for email subject line
    By Kevin K. Chlipa in forum Excel General
    Replies: 4
    Last Post: 11-28-2008, 06:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1