+ Reply to Thread
Results 1 to 3 of 3

Macro solves the mathematical expression

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Portugal
    MS-Off Ver
    2010
    Posts
    1

    Macro solves the mathematical expression

    Hello everyone!

    I need your help. I want a macro (sub) to solve the following mathematical expression knowing the x and y values:
    Sem Título.jpg

    The excel with the x and y values: expression.xlsx

    Does anyone know?
    I appreciate a lot your help. Thank you

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Macro solves the mathematical expression

    Hi there,

    Try using the following code:

    Please Login or Register  to view this content.
    You can change the values of the various constants to suit your own requirements.

    You'll need to save the workbook as an "Excel Macro-Enabled Workbook" with an extension of .xlsm, because the workbook you posted (extension .xlsx) cannot store VBA Code (macros)

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Last edited by Greg M; 11-25-2014 at 03:04 PM. Reason: Comment re file extension added

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro solves the mathematical expression

    How about just a formula?

    Row\Col
    A
    B
    C
    D
    2
    x
    y
    expression
    3
    -1.23
    2.00
    -0.3571928
    C3: =SUM(COS((A3 + {-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6}) / B3))
    Entia non sunt multiplicanda sine necessitate

+ 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. Creating a new function which solves m for which ErlanCsrv = 95% (Erlang)
    By SHUTTEHFACE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-10-2014, 03:29 PM
  2. please help with a formula that solves the problem
    By rajansood in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2013, 09:31 AM
  3. Parse a mathematical expression
    By avveerkar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2012, 08:47 PM
  4. $5 (£3.25) if you can create the macro that solves this problem!
    By Captain Useless in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2010, 07:57 PM
  5. Expression for Macro - help
    By Pasmatos in forum Excel General
    Replies: 4
    Last Post: 11-28-2005, 03:10 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