Hi, I wonder whether someone may be able to help me please.
I've put together some VB code in the attached file which performs the following:
- From the "All Data" sheet find those cells in column E which contain the Value "DIR".
- If this is found, create a unique distinct list from the associated values in columns D and B. In addition sum the associated values in column H.
- Paste this information to the "Expected Direct Activities" sheet.
I can run the macro and correctly create the unique distinct lists from columns D and B taken from the "All Data" sheet and paste this into the correct columns on the "Expected Direct Activities" sheet.
The problem I'm having is that code is only taking the first value it finds in column H, rather that totalling all of the associated figures.
To help illustrate the problem, I've created two 'Destination' sheets:
- The first is "Current Direct Activities". If you select the button on the "Macros" sheet the script will extract the information and paste to this sheet.
- The second is "Expected Direct Activities". This shows how the information should look if the macro was working correctly.
I just wondered whether someone could possible look at this please and let me know where I'm going wrong.
I am relatively new to VB, and it's taken me a while to get to this stage and understand the code, and I just wondered whether someone may be able to just tweak this code rather than change it completely.
Many thanks and kind regards
Bookmarks