VBA - Multiple values in a cell (comma separated) and return the corresponding values to a single cell (comma separated) with characters more than 255

Hari1992

New Member
Joined
May 7, 2021
Messages
11
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi,

I am looking for a VBS/ formula for the following. Here I am trying to achieve Dynamic Lookup for multiple values in a cell (comma separated) and return the corresponding values to a single cell (comma separated also). I am able to populate the B13 through the formula with Barnames column which has less than 255 char, but not working for B14 which has more than 255 char. Could someone suggest to me the Formula/Macro/VBS achieve this?

Thanks in advance,

1620751230587.png



Cell Formulas

B4- =REPT("-",255)

C4- =REPT("-",255)

B13- =TEXTJOIN(CHAR(10),1,IF(ISNUMBER(FIND(","&$A$4:$A$7&",",","&A13&",")),$B$4:$B$7,""))

B14- =TEXTJOIN(CHAR(10),1,IF(ISNUMBER(FIND(","&$A$4:$A$7&",",","&A14&",")),$C$4:$C$7,""))
 

Attachments

  • 1620751357494.png
    1620751357494.png
    15.9 KB · Views: 19
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

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