#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 385
Default VBA SumIF

Can I just say I am truelly learning Excel is never ending! This project
started rather modest. Ha!

Ok- I have a userform it displays an invoice # via cbobox. How do I have a
label on the form that looks at that invoice # goes to the producedata
worksheeet and does a sumif of the boxes sold. Thank you!
--
Though daily learning, I LOVE EXCEL!
Jennifer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default VBA SumIF

Hi Jennifer,

Basic SUMIF in VBA is

myVal = Application.sumif(range("A1:A10"),"a",range("b1:b1 0"))

Then yoiu just replace tyhe test value for the combo value

myVal = Application.sumif(range("A1:A10"),cboInvoice.Value , range("b1:b10"))

You then might want to test there are no errors

If IsError(myVal) Then
MsgBox "error"
End If


--
HTH

Bob Phillips

"Jennifer" wrote in message
...
Can I just say I am truelly learning Excel is never ending! This project
started rather modest. Ha!

Ok- I have a userform it displays an invoice # via cbobox. How do I have a
label on the form that looks at that invoice # goes to the producedata
worksheeet and does a sumif of the boxes sold. Thank you!
--
Though daily learning, I LOVE EXCEL!
Jennifer



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default VBA SumIF

Hi,

=sumif(RngInvoices, InvoiceNo, RngBoxesSold)

Where RngInvoices is the range containing your invoice numbers
InvoiceNo is the Invoice # selected
RngBoxesSold is the range contain the boxes sold

e.g. =Sumif($a$2:$a$1000,InvoicNo,$D$2:$d$1000)

HTH

"Jennifer" wrote:

Can I just say I am truelly learning Excel is never ending! This project
started rather modest. Ha!

Ok- I have a userform it displays an invoice # via cbobox. How do I have a
label on the form that looks at that invoice # goes to the producedata
worksheeet and does a sumif of the boxes sold. Thank you!
--
Though daily learning, I LOVE EXCEL!
Jennifer

Reply
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
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" Harry Seymour Excel Worksheet Functions 9 June 12th 07 10:47 PM
Sumif Tarig Excel Discussion (Misc queries) 5 May 10th 07 04:49 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


All times are GMT +1. The time now is 05:39 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"