Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum formula and if
Hi, I am trying to make the vba make a small calculation without success. I have tried the formula below. What I want to do is : if (sum of AH2 to AH1000) is greater than ( 0 ) do this, else do that. Thanks! Dim ca As Variant 'ca = "=sum(AH2:AH1000)" 'ca = "=SUM(R[2]C[33]:R[1000]C[33])" 'ca=FormulaR1C1 = "=sum(AH2:AH1000)" If ca 0 Then do this Else do that End If -- Mathieu |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum formula and if
if application.sum(AH2:AH1000)0 then -- Don Guillett Microsoft MVP Excel SalesAid Software "Mathieu" wrote in message ... Hi, I am trying to make the vba make a small calculation without success. I have tried the formula below. What I want to do is : if (sum of AH2 to AH1000) is greater than ( 0 ) do this, else do that. Thanks! Dim ca As Variant 'ca = "=sum(AH2:AH1000)" 'ca = "=SUM(R[2]C[33]:R[1000]C[33])" 'ca=FormulaR1C1 = "=sum(AH2:AH1000)" If ca 0 Then do this Else do that End If -- Mathieu |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum formula and if
Sub addif() If Application.Sum(Range("AH2:AH1000")) 0 Then MsgBox "HI" else msgbox "no" end if End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mathieu" wrote in message ... Hi, I am trying to make the vba make a small calculation without success. I have tried the formula below. What I want to do is : if (sum of AH2 to AH1000) is greater than ( 0 ) do this, else do that. Thanks! Dim ca As Variant 'ca = "=sum(AH2:AH1000)" 'ca = "=SUM(R[2]C[33]:R[1000]C[33])" 'ca=FormulaR1C1 = "=sum(AH2:AH1000)" If ca 0 Then do this Else do that End If -- Mathieu |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
sum formula and if
Thank you very much! I'll remember the "application.*" -- Mathieu "Don Guillett" wrote: Sub addif() If Application.Sum(Range("AH2:AH1000")) 0 Then MsgBox "HI" else msgbox "no" end if End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Mathieu" wrote in message ... Hi, I am trying to make the vba make a small calculation without success. I have tried the formula below. What I want to do is : if (sum of AH2 to AH1000) is greater than ( 0 ) do this, else do that. Thanks! Dim ca As Variant 'ca = "=sum(AH2:AH1000)" 'ca = "=SUM(R[2]C[33]:R[1000]C[33])" 'ca=FormulaR1C1 = "=sum(AH2:AH1000)" If ca 0 Then do this Else do that End If -- Mathieu |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula | Excel Worksheet Functions | |||
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible | Excel Discussion (Misc queries) | |||
Formula expected end of statement error, typing formula into cell as part of VBA macro | Excel Programming | |||
Excel 2002 formula displayed not value formula option not checked | Excel Worksheet Functions | |||
Commenting custom formula fields/formula on formula editor | Excel Programming |