Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I currently have an excel document that uses the sumif formula. Currently, it
checks column E for a specific word (in this case "Hydrogen") It then takes all the rows with "hydrogen" and adds up the numbers in the N column for those respective rows. My problem is that I need to turn this process into a macro rather than relying on a formula. Any direction on how to code this? I know it should be fairly simple but I'm a VBA novice. Thanks in advance! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MySumif()
Range("A1") = Application.SumIf(Range("E:E"), "Hydrogen", Range("N:N")) End mySumif You could change "Hydrogen" to reference a cell e.g. X1 Range("A1") = Application.SumIf(Range("E:E"), Range("X1"),Range("N:N")) HTH "supamari0" wrote: I currently have an excel document that uses the sumif formula. Currently, it checks column E for a specific word (in this case "Hydrogen") It then takes all the rows with "hydrogen" and adds up the numbers in the N column for those respective rows. My problem is that I need to turn this process into a macro rather than relying on a formula. Any direction on how to code this? I know it should be fairly simple but I'm a VBA novice. Thanks in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro with sumif | Excel Discussion (Misc queries) | |||
macro with sumif | Excel Worksheet Functions | |||
Nesting a sumproduct formula within a sumif formula. | Excel Discussion (Misc queries) | |||
multiply formula where 1 cell has a (sumif) formula as a result | Excel Worksheet Functions | |||
sumif formula in a macro | Excel Programming |