TEXTJOIN Alternative

mightymo77

New Member
Joined
Dec 16, 2021
Messages
17
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Hey guys. I was reading through some posts and everyone here seems very helpful. I have this formula below, however it's not working on my work machine which uses Excel 2016. Can anyone create an alternative for me that will function in Excel 2016? I would appreciate any help!

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(FIND($F2:$T2,"BLACK,BLUE")),$F$1:$T$1,""))
 
Ahh you had to leave Dim before ar, sorry for confusing
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
The code has to be in the workbook that you want to use it in.
 
Upvote 0
VBA Code:
Function jec(searchRng As Range, mergeRng As Range) As String
 Dim ar As Variant, i As Long, c00 As String
 Application.Volatile
 
 ar = searchRng
 For i = 1 To UBound(ar, 2)
    If ar(1, i) = "WARNING" Or ar(1, i) = "FAIL" Then c00 = c00 & ", " & mergeRng(1, i)
 Next
 jec = Mid(c00, 3)
End Function

Excel Formula:
=jec(F2:T2;$F$1:$T$1)
 
Upvote 0
Solution
The code has to be in the workbook that you want to use it in.
This is what I am doing:

1 - Opening my csv

2 - Press ALT + F11 for a VBA window > Expand VBAProject, right-click Modules folder, insert, Module > Paste JEC's code > close that little window, close the XLSB window (where the module folder is on the left) > This brings me back to the regular csv file

3 - Paste JEC's second code into X2. Getting the error.
 
Upvote 0
See post#22.
Also csv files do not retain formulae when you save & close them.
 
Upvote 0
See post#22.
Also csv files do not retain formulae when you save & close them.
I'm not saving and closing the csv file. Please post #25 and follow what I am doing closely. If I am doing something wrong let me know.
 
Upvote 0
Please see the attached image. After pasting the code in the module, I am close window 2, then 1, which puts me back in window 3 (which is my csv file). If I press ALT + F11 again, the code is still in the module. So, is my process wrong?
 

Attachments

  • Excel Code.png
    Excel Code.png
    93.2 KB · Views: 16
Upvote 0
Maybe you didn't read post#22.
Also if you put the formula into the csv file & then save it as a csv file, you will loose the formula. Is that what you want?
 
Upvote 0

Forum statistics

Threads
1,215,032
Messages
6,122,772
Members
449,095
Latest member
m_smith_solihull

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