+ Reply to Thread
Results 1 to 8 of 8

macro to paste numeric values for all references in an equation

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    lawndale, ca
    MS-Off Ver
    Excel 2007
    Posts
    9

    Cool macro to paste numeric values for all references in an equation

    Say cell a1 has a formula that is =+b4+d8+e10 and b4=8 , d8=10 , e10=5 I want the macro to return =+8+10+5 . I actual want it for all vlookup formulas in the worksheet My worksheet has multiple vlookups in each individual cells example '=VLOOKUP(A4,Advertising!E:R,14,FALSE)+VLOOKUP(A4,Advertising!E:R,15,FALSE)

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: macro to paste numeric values for all references in an equation

    Quote Originally Posted by chriszoma View Post
    example '=VLOOKUP(A4,Advertising!E:R,14,FALSE)+VLOOKUP(A4,Advertising!E:R,15,FALSE)
    Instead of using like the above, just reference the output columns within array
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit: But E to R the number of columns is 14 only and mentioning 15 will result error
    Last edited by :) Sixthsense :); 05-31-2013 at 12:58 AM.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-12-2012
    Location
    lawndale, ca
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: macro to paste numeric values for all references in an equation

    My boss does not understand vlookups so she wants me to key in each numeric number for each vlookup within each cell there are hundreds of calculation using vlookups and most cell have two to five vlookups inside the cell's formula. I want to keep the vlookups in tack for me because the input data changes each day amd the vloopups I dont have to key all the number but I want to convert the vlookup in each cell to read for example =+215,000+245,455.75-315,000 not =775,455.75 as paste values do

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: macro to paste numeric values for all references in an equation

    Still I am unable to understand what is your exact requirement is??

  5. #5
    Registered User
    Join Date
    11-12-2012
    Location
    lawndale, ca
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: macro to paste numeric values for all references in an equation

    Cell B4 has a formula--> =VLOOKUP(A4,Advertising!E:R,14,FALSE)+VLOOKUP(A4,Advertising!E:R,2,FALSE)
    =VLOOKUP(A4,Advertising!E:R,14,FALSE) returns 215,0000
    =VLOOKUP(A4,Advertising!E:R,2,FALSE) returns 245,455.75
    I want a macro to convert B4 to show =+215,000+245,455.75 and all other cell with vlookup calculations
    I don't want B4 to read =460,455.75 which is an easy paste special values

    Thank so much if anyone can help

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: macro to paste numeric values for all references in an equation

    Select the cell(s) that you want to convert, then run the code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-12-2012
    Location
    lawndale, ca
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: macro to paste numeric values for all references in an equation

    The Code needs some more work. Only works for the two vlookups in cell with addition or substaction but not multiplication or division. And it won't work for 3 or more vlookups in one cell calculation

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: macro to paste numeric values for all references in an equation

    Then upload your file with the formula

    You only gave
    =VLOOKUP(A4,Advertising!E:R,14,FALSE)+VLOOKUP(A4,Advertising!E:R,2,FALSE)
    =VLOOKUP(A4,Advertising!E:R,14,FALSE) returns 215,0000
    =VLOOKUP(A4,Advertising!E:R,2,FALSE) returns 245,455.75

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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