Multiselect drop down using VBA code is not totaling correctly

ShanaStJ

New Member
Joined
Feb 16, 2024
Messages
11
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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,215,110
Messages
6,123,143
Members
449,098
Latest member
Doanvanhieu

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