LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 259
Default Another rascally VBA SUMPRODUCT issue

G'day all

This is not a biggy as I am only playing with this workbook.

I am not a big fan of nesting hundreds of formulas, regardless if I can
turn Auto-Calc off or not; Over my works under-resourced, over-stretched
network, it can take forever to make a single recalculation so I look to
VBA to do most in order to side-step nesting.

Moving Forward:

This evaluates to cCell = EMPTY

Sub Update_Col_C()

Dim sSht As Worksheet
Dim mysYear As Range, mysMonth As Range, mysEmp As Range, mysExp As
Range, mysAmt As Range

Dim tSht As Worksheet
Dim mytYear As Range, mytMonth As Range, mytEmp As Range, mytExp As Range
Dim c1 As Range, cCell As Range

Set sSht = Worksheets("Expenses")
Set mysYear = sSht.Range("$A$2:$A$5000")
Set mysMonth = sSht.Range("$B$2:$B$5000")
Set mysEmp = sSht.Range("$D$2:$D$5000")
Set mysExp = sSht.Range("$E$2:$E$5000")
Set mysAmt = sSht.Range("$H$2:$H$5000")

Set tSht = Worksheets("Summary")
Set mytYear = tSht.Range("$B$1")
Set mytMonth = tSht.Range("$D$1")
Set mytEmp = tSht.Range("$C$2")


''used syntax that failed envoking ( Type MisMatch Error 13 ):
''Set mytexp = ccell.offset(0, -2).value


Set c1 = tSht.Range("C3:C134")

For Each cCell In c1
With cCell
.Value = WorksheetFunction.SumProduct((mysYear = mytYear) *
(mysMonth = mytMonth) * (mysEmp = mytEmp) * (mysExp = mytExp) * (mysAmt))
End With
Next cCell

End Sub

As always, thoughts, and or critique welcomed

Cheers
Mick.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT issue ISAF Media Analysis[_2_] Excel Discussion (Misc queries) 4 November 5th 09 02:43 PM
SUMPRODUCT Issue Stuck Excel Worksheet Functions 5 July 16th 09 01:18 AM
I believe this is a SUMPRODUCT issue WLMPilot Excel Worksheet Functions 2 August 14th 08 09:35 PM
Issue with sumproduct Steved Excel Worksheet Functions 8 July 18th 05 11:19 PM
SUMPRODUCT issue TonyL Excel Worksheet Functions 2 May 27th 05 12:46 AM


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"