I need to convert:
Formula:
Please Login or Register to view this content.
to VBA code and find a way to loop it so I can fill column K (based on the length of column G) of the example with the correct sums.
sumifexample.xlsx
I need to convert:
Formula:
Please Login or Register to view this content.
to VBA code and find a way to loop it so I can fill column K (based on the length of column G) of the example with the correct sums.
sumifexample.xlsx
You have prepared col G & H, Criteria 1 & 2.
Do you want to keep it remain as it is, or is it fine just the data that have month=N1?
This is to output the only data that have Month = N1
to a Sheet Module
To a standard module![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Last edited by jindon; 11-11-2015 at 07:43 PM.
Hi lakamas,
Welcome to the Forum - here's another routine:
![]()
Please Login or Register to view this content.
Last edited by xladept; 11-11-2015 at 07:45 PM. Reason: Clear K
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
This is closer to what you said:
![]()
Please Login or Register to view this content.
Perhaps.
![]()
Please Login or Register to view this content.
If posting code please use code tags, see here.
Guys thank you for your time,
Both of them work in their way but not exactly what I need, my problem is that I can't really understand or make changes to the code(sorry for my poor vba skills, I just started)
As for the criteria1 and 2 , this have been extracted from code1+code2 columns aiming to get as a result all the unique pairs. I have already done it so no need for changes there (always a better/efficient way to do it would be good to know)
My target is to read the already made criteria from G and H columns and do the sums. After filling the cell go to next cell of column K and do that again (based on the new Criteria).
![]()
Please Login or Register to view this content.
Last edited by lakamas; 11-12-2015 at 09:06 AM.
Hi lakamas,
My last post with the lakamasII routine is driven by the G & H entries
You're welcome and thanks for the rep
![]()
Please Login or Register to view this content.
Worksheet Change event code.
1) If Cell N1 changed, call "test" procedure.
test procedure code
1) Store data in an array, variable a, to speed up the process.
2) Loop through the data and find the rows that have N1 value in Co.C
3) When found, store corresponding data to the Dictionary under unique key of Col.A & Col.B.
4) When duplicates found, add amount of Col.D to the Dictionary item.
5) OutPut the result.
@xladept the code works great and I understood everything, thank you.
I just need one more thing now. When all data are in the same worksheet everything works fine but in my case I have the collums a,b,c and d in sheet1 and the rest in sheet2.
I tried to replace "A" with Sheet1!A but it didnt work , any ideas?
@jindon thank you for your time and efford.![]()
I think I got them All
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks