Results 1 to 3 of 3

Thread: Macro sum problem in excel 2007

  1. #1
    Join Date
    Dec 2008
    Posts
    63

    Macro sum problem in excel 2007

    I am having problem with macros in Excel 2007. I created the following macro: If Range ( "M10") = 2 Then Range ( "K20"). Copy Range ( "D3") This little function allows me to paste the contents of the cell K20 in a table cell D3.
    So far, no problem. The concern is that I wanted the cell K20 corresponds to the sum of cells M17 + M18 + M19. And there, it's corse. Excel installation error # REF! from the time when the formula contains a sum.
    For the moment, so I have to manually enter the number 9 (sum of M17-18-19) for example, so that the button on the copy which I support in cell D3.

    Can anyone know tips to do this ?

    Thanks

  2. #2
    Join Date
    Dec 2008
    Posts
    27

    Re: Macro sum problem in excel 2007

    For the Sum function is a beach to be given.
    = SUM (A1: A20)
    and nothing else.

  3. #3
    Join Date
    May 2008
    Posts
    90

    Re: Macro sum problem in excel 2007

    K20 in the box I put the following formula
    IF (ESTERREUR (M17 + M18 + M19 );""; M17 + M18 + M19)
    This formula is the sum of your 3 cells, and if ever there is an error (eg there is a character instead of a number in the formula), and it is the emptiness in your case. Explanation: ESTERREUR () checks what is inside the parenthesis, if it # returns a ref, then it will be there after 1st semicolon, in this case it is the "" nothing, but you can replace by 0. Otherwise, if there is no error and therefore the amount is correct and it is there after the 2nd semi-colon, or in our case ta sum (M17 + M18 + M19).

Similar Threads

  1. Excel 2003 Macro doesn't work in Excel 2007
    By jjaw in forum Windows Software
    Replies: 3
    Last Post: 03-01-2014, 03:28 PM
  2. Excel 2007 macro help needed
    By AZUL in forum Software Development
    Replies: 4
    Last Post: 19-11-2009, 06:10 PM
  3. Macro for deleting every alternate row in Excel 2007
    By Akiraa in forum Windows Software
    Replies: 3
    Last Post: 22-10-2009, 10:19 PM
  4. Cannot find macro working in excel 2007
    By Visala in forum Windows Software
    Replies: 3
    Last Post: 06-08-2009, 11:47 PM
  5. Set the Macro Security Level in Excel 2007
    By NIcaBoy in forum Windows Software
    Replies: 3
    Last Post: 21-04-2009, 02:04 PM

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
  •  
Page generated in 1,653,006,257.59147 seconds with 17 queries