+ Reply to Thread
Results 1 to 17 of 17

macro to get formula answers with data

  1. #1
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post macro to get formula answers with data

    dear friends below formula work fine for me.but i need to get that formula answer with all data.
    ex-
    80+80=160
    but this formulas giving only last answer =160.i need see that 80+80 also.pls anybody can make macro for this.thanks.

    B5 cell
    Please Login or Register  to view this content.
    C5 cell
    Please Login or Register  to view this content.
    D5 cell
    Please Login or Register  to view this content.
    E5 cell
    Please Login or Register  to view this content.
    Last edited by johncena; 05-03-2010 at 12:49 AM.

  2. #2
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: macro to get formula answers with data

    john ,
    could you attach an example file with dummy data.
    This could help to find a solution quickly.

  3. #3
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    thanks MarMo here i have attached my doc.
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: macro to get formula answers with data

    Quote Originally Posted by johncena
    this formulas giving only last answer =160.i need see that 80+80 also
    First can we enquire as to why ?
    (you can use F9 in the formula bar or evaluate tool to visually see the component parts of the resulting value but I suspect that's not viable here)

    In terms of the "Macro" - what are you looking to do ?

    Are you looking to replace the existing formula (say with a string of valid results via a formula with + operator) or are you looking to return the various elements comprising the formula result elsewhere ?

    If you're looking to replace the formula altogether you have an issue in so far as you would (I think) need to use a Sub routine rather than in-cell UDF ...
    In turn this raises issues regards precedent alterations needing to invoke the sub routine
    ie you change the source values you need to invoke the macro simultaneously to update the results which could get quite convoluted quite quickly...

    All of the above is meant to be interpreted as "is it really worth it" ?


    Thinking "outside the box" could you not use a Pivot Table as source for your calcs ? This would also give you drill through detail on the PT itself in terms of investigating results

    In terms of PT config - column D would be either Row Field / Column Field, Column E would be the opposite of Col D (ie Row/Column), Colummn G would be Data Field set to Sum.

    With the PT configured you can use GETPIVOTDATA function from your B5:E5 cells to retrieve the values, you can drill into the totals on the pivot to see the component parts.

  5. #5
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    dear sir DonkeyOte my production sheet getting from production department.at the moment I'm replacing daily production sheet to my document first sheet & answer automatically getting from second sheet.my problem is production department people if give same data in two days i can't check it.because i have only total answers.i think u can understand my problem.

  6. #6
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    See attached file where I added this macro taht does calculation as you need.
    Macro requires you put on row 3 of 'Dyed Yarn' sheet arn to associate with row 5 to look for them in sheet 1.
    Macro needs also the columns of the range where put toalizations, see in code:
    'range where totalize
    myRange = "b:al"
    Macro will automatically starts when you switch from first shet to 'Dyed Yarn' sheet
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    wow thanks a lot sir antoka05.u help me again.everything work fine.only one change i need.i don't want answer in this format.
    5+10=15
    i need only =5+10
    pls make this change.thanks a lot again.

  8. #8
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    See attached file.

    Regards,
    Antonio
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    ohh.sorry sir i think not clear my requirement.i need like this.one place have 5 & another place have 10. then answer should =15.if i click that cell then only should display =5+10.other wise it should display only 15.your report is ok.just add "=" to first.
    ex-
    5+10
    should =5+10
    pls see this attachment.
    Attached Files Attached Files
    Last edited by johncena; 04-29-2010 at 07:15 AM.

  10. #10
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    See attached file, I hope it's what you need.

    Regards,
    Antonio
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    OHH thanks a lot for your reply sir.but why u put apostrophe to first.i don't want that apostrophe.i know if we remove that it will calculate,it's ok.i need just calculate all values.it like this ....=50+60+40
    cell value is=150 if i click that cell then formula bar should display =50+60+40,
    i have copy my yesterday production sheet to your sheet.but it's not giving correct answers.pls check this..
    Attached Files Attached Files
    Last edited by johncena; 04-30-2010 at 02:57 AM.

  12. #12
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    I think I finally understand what you need.
    See attached file.

    Regards,
    Antonio
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    thanks u very much for your great help.my first matter is solved.second sheet "B6 to M6" answer is correct.but "N6 to AL6" answer not giving this macro.if u want to change anything in sheet two u can change.i need only correct answers.pls check it.thanks a lot again...
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    You want my macro change only cells in range B6:M6 and leave unchanged other cells?

    Please tell me so I can modify correctly the macro.

    Regards,
    Antonio

  15. #15
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: macro to get formula answers with data

    no sir B6 to AL6 all answers i need.but this macro answer giving only B6 to M6 range.other range values(N6:AL6) not calculating.pls check my last attachment.
    Last edited by shg; 05-02-2010 at 07:07 PM. Reason: deleted spurious quote

  16. #16
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: macro to get formula answers with data

    I apologize for my previous error but I didn't understand exactly what was wrong.
    See attached file, it seems running fine.
    Macro to run fine, need keys to look for in range b3:al3 of 'Dyed Yarn' sheet.
    For example, in cell B3 there is '40/2,SSP' representing count and yarn separated by a comma.

    Regards,
    Antonio
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Post Re: macro to get formula answers with data

    Quote Originally Posted by antoka05 View Post
    I apologize for my previous error but I didn't understand exactly what was wrong.
    See attached file, it seems running fine.
    Macro to run fine, need keys to look for in range b3:al3 of 'Dyed Yarn' sheet.
    For example, in cell B3 there is '40/2,SSP' representing count and yarn separated by a comma.

    Regards,
    Antonio
    wow thanks a lot friend.u done a great help for me.thanks a lot again.everything work very well...

+ 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