#1
|
||||
|
||||
Required VBA Codes to automate sum-up the 2 different groups
I have a file with 2 types of "Material".One is having end with "S" and rest other than ending with "S" .I want to sum all of the Materials ( Col.B ) according to Material group ( Col.D ) in Column J and K,where define material category.
Can it be possible thru VBA codes only? Pl.refer attach file for more clarification. |
#2
|
||||
|
||||
You don't need VBA for that; you can do it with formulae:
Code:
In J4 =SUMPRODUCT((D:D=H4)*(RIGHT(B:B,1)<>"S"),F:F) In K4 =SUMPRODUCT((D:D=H4)*(RIGHT(B:B,1)="S"),F:F)
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Thanks for the nice solution.Glad to find it.
|
#4
|
||||
|
||||
Cross-posted at: http://www.eileenslounge.com/viewtopic.php?f=27&t=15577
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
||||
|
||||
Hi macropod,
Both question are of different nature.At eileen forum,I have asked an excel formula for my thread but at msofficeforums,I want to ask a VBA code solution and not to provide as desired . Can we link that both excel formula and VBA codes are same to each other? |
#6
|
||||
|
||||
The basic issue, though, is the same - how to populate the output range with the data.
A VBA solution might consist of nothing more than output the formulae I posted to the relevant cells. Hardly a great advance on what you already have and the end result would be exactly the same. So, unless you can explain why a formulaic approach, which will automatically take account of any changes to the data, isn't suitable, whereas a VBA one wouldn't necessarily be so flexible, I don't propose to spend any more time on this.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Tabs and Groups | KHenry | Word | 0 | 10-08-2013 09:37 AM |
Bar Graph in Groups | Alaska1 | Excel | 3 | 12-17-2012 05:20 PM |
Contacts List groups | WildBill | Outlook | 1 | 09-21-2011 09:09 PM |
Arranging Into Groups | skoz55 | Excel | 1 | 09-07-2011 12:02 AM |
Some contacts are listed in groups I don't want | ironwoods | Outlook | 0 | 07-29-2010 04:40 PM |