Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Would anybody be able to help me with the following problem.
For myEngTotal.Formula I want to use a sumif - with the first part of the range being an absolute range and the sum range being relative. The criteria I want to use is "total". I can't seem to get the syntax right on this. Can anybody help? Thanks much in advance, Anita Dim myEngRange As Range Dim myEngTotal As Range Range("b1").Activate Set myEngRange = ActiveSheet.UsedRange Set myEngTotal = myEngRange.Offset(myEngRange.Rows.Count).Rows(1) myEngTotal.Cells(1) = myEngRange.Columns(1).Address myEngTotal.Cells(1) = myEngRange.Columns(1).Address(False, False) myEngTotal.Formula = "=sum( " & myEngRange.Columns(1).Address(False, False) & ")" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don;t think I'm really understanding your question fully, but does the
following help get you started? Dim myEngRange As Range Dim myEngTotal As Range Range("b1").Activate Set myEngRange = ActiveSheet.UsedRange Set myEngTotal = myEngRange.Offset(myEngRange.Rows.Count).Rows(1) myEngTotal.Formula = "=sumif(" & myEngRange.Resize(, 1).Address(False, True) _ & ",""Total""," & myEngRange.Columns(1).Address(False, False) & ")" -- Vasant "a" wrote in message link.net... Would anybody be able to help me with the following problem. For myEngTotal.Formula I want to use a sumif - with the first part of the range being an absolute range and the sum range being relative. The criteria I want to use is "total". I can't seem to get the syntax right on this. Can anybody help? Thanks much in advance, Anita Dim myEngRange As Range Dim myEngTotal As Range Range("b1").Activate Set myEngRange = ActiveSheet.UsedRange Set myEngTotal = myEngRange.Offset(myEngRange.Rows.Count).Rows(1) myEngTotal.Cells(1) = myEngRange.Columns(1).Address myEngTotal.Cells(1) = myEngRange.Columns(1).Address(False, False) myEngTotal.Formula = "=sum( " & myEngRange.Columns(1).Address(False, False) & ")" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
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 | Excel Worksheet Functions | |||
Formula for If - SUMIF | Excel Discussion (Misc queries) | |||
Is there a MAXIF formula similar to the SUMIF formula? | Excel Discussion (Misc queries) |