Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumif in vba
Hi Im trying to use =(SUMIF(teams,Home,power)) with vba. teams,home
and power are named ranges. The calc works perfect in excel. Ive tried Dim xt As Double xt = Application.WorksheetFunction.SumIf(Range("teams") , Range ("Home"), Range("Power")) MsgBox xt. The reason I want to do this is, in excel the calc is dependent on other data, and when calculated I dont want the value to change, but because its calc from other data which changes daily the value changes to, so I thought Id calc using vba and write the value to appropiate range then when values change this result wont. Basically its the previous days result. Thanks Regards Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumif in vba
Is Range("home") the criteria for the SUMIF? -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=102011 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumif in vba
On 31 May, 09:59, royUK wrote:
Is Range("home") the criteria for the SUMIF? -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile:http://www.thecodecage.com/forumz/member.php?userid=15 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=102011 thanks for replying. Yes it is. Robert |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumif in vba
The code works for me on a dummy workbook. Is Range("Home") a single cell? -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=102011 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
sumif in vba
Hi Robert,
The syntax you have used should work as can the one below: xt = [SUMIF(teams,Home,power) ] Check your named ranges to see if the ranges 'teams' and 'power' are the same dimensions, and 'Home' holds a valid criteria. Regards Robert McCurdy "RobcPettit" wrote in message ... Hi Im trying to use =(SUMIF(teams,Home,power)) with vba. teams,home and power are named ranges. The calc works perfect in excel. Ive tried Dim xt As Double xt = Application.WorksheetFunction.SumIf(Range("teams") , Range ("Home"), Range("Power")) MsgBox xt. The reason I want to do this is, in excel the calc is dependent on other data, and when calculated I dont want the value to change, but because its calc from other data which changes daily the value changes to, so I thought Id calc using vba and write the value to appropiate range then when values change this result wont. Basically its the previous days result. Thanks Regards Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
=SUMIF | Excel Discussion (Misc queries) | |||
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" | Excel Worksheet Functions | |||
Embedding a Sumif in a sumif | Excel Worksheet Functions | |||
nested sumif or sumif with two criteria | Excel Worksheet Functions | |||
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function | Excel Worksheet Functions |