Drop Menu with static options to count defined cells

rbone

New Member
Joined
Aug 19, 2019
Messages
20
Hello,
My title isn't the best description, but this is what I'm look for and a link of the data.

I am looking to have a Macro create a drop down menu (or some other way to make the selection) on worksheet "Agency" with 7 unchanging options. Location 1, location 2, location 3, location 4, etc... (The locations are not named in the workbook anywhere)

Upon selecting "Location 1" search Column A for Agency 02 & Agency 11 then add the numbers in corresponding rows at column G.

Upon selecting "Location 2" search Column A for Agency 07 & Agency 09 & Agency13 then add the numbers in corresponding rows at column G.

Same with Locations 3 through 7, but with different Column A Agencies. The Agency names are not actually Agency **, they are all named differently.

If Agency ** is not found, then count 0 and move to the next.

Place the sum on worksheet "Totals" in cell "B5"

open


Here is a link to the image if it's not showing: https://drive.google.com/open?id=1T5Tgvpiw4m8x8NlhjFE9d7-h1maeE4A1
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Can you put this into a pivot table and use a slicer?


As long as the data looks the same and has not been changed on sheet "Agency" when the macro is finished, it can be done in any way that works. Even if it copies the data to a new worksheet to be manipulated, then deletes that worksheet after the total is added the "Totals" worksheet.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top