+ Reply to Thread
Results 1 to 5 of 5

Adding Cell Values To .HTMLBody in Excel VBA

  1. #1
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Adding Cell Values To .HTMLBody in Excel VBA

    Hello,

    I am having some real trouble referencing multiple cell values in the body of the email I need to send. I have a series of macros that run to trim down data and put it into a table format and paste it into an email. Everything is perfect, except getting the cell values adding into the text of the email to string along with my predetermined text. In the code below in the .htmlbody tag, I indicated which cell references I need. Can you please help?

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-05-2015
    Location
    Finland
    MS-Off Ver
    Home and Business 2013
    Posts
    50

    Re: Adding Cell Values To .HTMLBody in Excel VBA

    Hi, try this:

    During the interval, " & sheets("Macros").range("H4").value & " calls exceeded the Max Delay threshold of 300 seconds.

  3. #3
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Re: Adding Cell Values To .HTMLBody in Excel VBA

    Thank you so much, that has worked perfectly! Now I have a new dilemma. One of the cells I am referencing in my VBA is a MIN or a MAX formula [=MIN(Res!A:A)]. This returns a time value in Military Time. The cell value is variable based on the results of another macro that runs. I need the contents of this cell to paste into the email function and not change the formatting. I think this is done with a format VBA code but I can't seem to get it right.

    The line that needs the formatting wrap is : During the " & sheets("Macros").range("S28").value & " -" & sheets("Macros").range("S29").value & " interval (s), "

    The S28 and S29 cell values appear as a military time stamp however the is resulting from the Min & Max functions.

    The full .HTMLBody code is below

    Please Login or Register  to view this content.
    Thank you for your help!

  4. #4
    Registered User
    Join Date
    08-05-2015
    Location
    Finland
    MS-Off Ver
    Home and Business 2013
    Posts
    50

    Re: Adding Cell Values To .HTMLBody in Excel VBA

    Hi, how exactly does the value change when it is transferred into the email? The 'Range("X").Value' should only return a value of the cell and not change it.

  5. #5
    Registered User
    Join Date
    09-22-2015
    Location
    Eau Claire, WI
    MS-Off Ver
    2010
    Posts
    65

    Re: Adding Cell Values To .HTMLBody in Excel VBA

    Converting it to a decimal for some reason. Even when I formatted the cell to a time reference, it still did not work right. I converted the existing cell value to an =Time("A1", HH:mm) and it works perfect now. Something weird with the formatting I guess. Thanks for looking for me, I appreciate it!

+ 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. Help with HTMLBody formatting
    By starlev in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-20-2015, 10:00 AM
  2. How to insert signature in email using .HTMLbody
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2015, 06:28 AM
  3. adding of cell values to corresponding rows values
    By raj10 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-01-2013, 07:05 AM
  4. Replies: 4
    Last Post: 06-28-2012, 07:08 AM
  5. Cell value in HTMLBody
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2011, 08:03 AM
  6. Adding cell values that are dependent on adjacent cell values
    By globulous in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-27-2009, 10:37 AM
  7. [SOLVED] outlook htmlbody
    By Erin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2005, 03:06 AM

Tags for this Thread

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