LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.fr.excel
external usenet poster
 
Posts: 2
Default How to write a VBA code to select certain rows based on certain conditions

I need help to write part of a VBA code in Excel. I am trying to do
calculations on rows that meeting certain requirements, but I do not
know how to established that in VBA. I know that if I use the
worksheet itself, I can do something like SUMIF() function. But, when
I put the same function in the VBA editor, it returns error. A simple
version of my data:

Group No Member No Amount spent
1 1 10
1 2 3
1 3 4
2 1 6
2 2 1
3 1 12
4 1 3
4 2 1

I am trying to calculate the total amount spent based on the group no.
FOr example, how much does group no.1 spent, how much does group no.2
spent, etc.

I appreciate anybody who can help me with this. Thank you very much.
 
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
Write a macro that hides rows based on empty cells Mac0001UK Excel Discussion (Misc queries) 3 March 10th 09 12:37 PM
VBA code to select rows ub Excel Discussion (Misc queries) 4 February 15th 09 11:05 PM
+/- in sheet2 based on conditions and dynamic rows in sheet1 deepika :excel help[_2_] Excel Discussion (Misc queries) 0 February 4th 08 08:33 AM
Conditionally summing cells based on conditions in other rows Bert Excel Worksheet Functions 3 June 20th 06 11:06 AM
How do I write a formula to color code based on dates provided or. jaime Excel Worksheet Functions 2 February 17th 05 12:41 AM


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

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"