Multiselect drop down using VBA code is not totaling correctly

ShanaStJ

New Member
Joined
Feb 16, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
VBA code has been entered and it successfully works except now it's adding the same title at the bottom when my goal is to calculate the total of each one. For example, there are two structured when I want it total that versus separate it out. I have included the formula's I'm using. I'm also having a problem of it working until I reopen the spreadsheet as even a macro enabled.

Formula for the type of activity
=UNIQUE(TRANSPOSE(TEXTSPLIT(TEXTJOIN(",",,J12:J38),",")))

Formula for adding those activities even if multiple are entered int he same box from the drop down.
=SUM(--(TEXTSPLIT(TEXTJOIN(",",,$J$12:$J$38),",")=J39))

1708110193107.png


Any help greatly appreciated.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
How about
Excel Formula:
=UNIQUE(TRIM(TEXTSPLIT(TEXTJOIN(",",,J12:J38),,",")))
and
Excel Formula:
=SUM(--(TRIM(TEXTSPLIT(TEXTJOIN(",",,$J$12:$J$38),","))=J39))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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