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: 130
Default worksheetfunction question

Sub rework()
Dim ans As Variant
Dim ans2 As Variant
Dim var As Variant

ans = InputBox("Which advisor do you wish to use?")
ans2 = InputBox("Which payment method do you wish to use?")

var = WorksheetFunction.SumProduct(--(Range("A1:A10000") = ans),
--(Range("H1:H10000") = ans2))

MsgBox (var & " cases match your criteria.")
End Sub

I'm trying to work out how to use WorksheetFunction so I can make some
macro's that can calculate data without having to enter the formulas into the
spreadsheet. I tried off with .Index and got that to work quite easily, but
..SumProduct would be the most useful for me but i'm unsure how to make them
different to than if I was typing the formula into a cell...
 
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
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
Can't use WorksheetFunction Yossi Excel Discussion (Misc queries) 5 January 25th 06 10:07 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
WorksheetFunction Mike Fogleman Excel Programming 2 January 1st 04 11:17 PM
WorksheetFunction Stuart[_10_] Excel Programming 3 November 13th 03 12:33 AM


All times are GMT +1. The time now is 01:11 AM.

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

About Us

"It's about Microsoft Excel"