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 ?
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).
|Tags: 2007, excel, excel 2007|
|Thread Tools||Search this Thread|
|Similar Threads for: "Macro sum problem in excel 2007"|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Excel 2003 Macro doesn't work in Excel 2007||jjaw||Windows Software||3||03-01-2014 03:28 PM|
|Excel 2007 macro help needed||AZUL||Software Development||4||19-11-2009 06:10 PM|
|Macro for deleting every alternate row in Excel 2007||Akiraa||Windows Software||3||22-10-2009 10:19 PM|
|Cannot find macro working in excel 2007||Visala||Windows Software||3||06-08-2009 11:47 PM|
|Set the Macro Security Level in Excel 2007||NIcaBoy||Windows Software||3||21-04-2009 02:04 PM|