Author Topic: Excel VBA Question  (Read 2777 times)

0 Members and 1 Guest are viewing this topic.

Jim Yadon

  • Guest
Excel VBA Question
« on: October 04, 2005, 10:05:59 AM »
So I am trying to automate a formula for SUM based on multiple criteria (SUM(IF...)). This is one of those formulas that requires the use CTRL+SHIFT+ENTER chords to activate. The following code does not do it for me... 
Code: [Select]
TallyFormula = "{=SUM(IF((" & UnitRange & "=" & CurrentUnitLocation & ")*(" & _
                                 DescriptionRange & "=" & CurrentDescLocation & ")," & _
                                 QtyRange & "))}"

Range("C30").Value2 = TallyFormula

I was thinking maybe the use of ANSI codes for the appropriate keys but I am unable to locate a reference at the moment to give the correct codes.

Can anyone help?

Murphy

  • Guest
Re: Excel VBA Question
« Reply #1 on: October 04, 2005, 10:22:10 AM »
Jim,

Easiest way to figure this out is to go into Excel. Record New Macro, paste your simple formula into a cell and then do the CTRL SHIFT ENTER thing.
Stop the macro then go into what was recorded. That should give you some help into what you need to do to achieve the same results.
Hope this helps.

Murph

Jim Yadon

  • Guest
Re: Excel VBA Question
« Reply #2 on: October 04, 2005, 12:09:05 PM »
Thanks Murph...

Code: [Select]
.FormulaArray