+ Reply to Thread
Results 1 to 4 of 4

VB; using cell value instead of formula

  1. #1
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    VB; using cell value instead of formula

    Good day,

    i am using a standard automated form for email, so i won't paste all the coding, but the line wich cause me trouble;

    Please Login or Register  to view this content.
    A18 refer to a vlookup formula wich works fine, it goes into a list of users and add the concerned person email in A18.

    Please Login or Register  to view this content.
    If i use the vlookup formula to get the email, when i send it, there is nothing in my outlook outbox, and excel/outlook don't return me any error. My guess is when asking excel to use A18 cell, it use the formula within it, instead of the actual value, and then outlook or excel nullify the vba request. Because if i go in cell A18 and enter the same email manually without the formula, it works.

    solution? :/

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VB; using cell value instead of formula

    Sheet2.Range("A18") will return the value in the cell, not the formula.

    If it returned the formula you would see something like this in the cc field of the email.

    [email protected];=IF(VLOOKUP(B2;X1:Y97;2;FALSE)=0;"";VLOOKUP(B2;X1:Y97;2;FALSE))
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Re: VB; using cell value instead of formula

    Ok, any clue why it doesnt work if i use vlookup but does when i input manually ? i dont get any error from excel nor outlook .. so can't know where it fails.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VB; using cell value instead of formula

    Can you post the rest of the code?

+ 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. [SOLVED] Enter formula result from one cell into a COUNTIF formula in another cell. Help please!
    By gregrach in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  2. Replies: 0
    Last Post: 03-20-2014, 10:57 AM
  3. [SOLVED] Retaining formula cell references when copying a formula to a different cell
    By FrankParisi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2013, 07:05 AM
  4. Replies: 5
    Last Post: 05-07-2013, 08:34 AM
  5. Change Cell Font Color if Cell Contains Formula Referencing Another Cell
    By wilcox.patrick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2012, 10:24 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