Forum Discussion

Matt McCormack's avatar
Matt McCormack
Copper Contributor
Apr 19, 2018

Running A Created Excel Add IN

First of all this guy is a BOSS for creating this. However, I have the add in activated in my worksheet but can't figure out how to run it. Can anyone help with how to run a created excel add in?

 

" 

Hi

 

You could create one if you don't mind a bit of dabbling with VBA. 

 

(Waring: I'm not familiar with textjoin() but wrote this code based on the description. Not extensively tested.)

 

Steps:

 

1. Open a blank workbook

2. Press ALT+F11 to open the VBA editor

3. In the Project window on the left, right-click on the workbook name and choose Insert ->Module

4. Paste this code in the resultant window

 

Option Explicit
Function TEXTJOIN(delimiter As String, ignore_empty As String, ParamArray textn() As Variant) As String
    Dim i As Long
    For i = LBound(textn) To UBound(textn) - 1
        If Len(textn(i)) = 0 Then
            If Not ignore_empty = True Then
                TEXTJOIN = TEXTJOIN & textn(i) & delimiter
            End If
        Else
            TEXTJOIN = TEXTJOIN & textn(i) & delimiter
        End If
    Next
    TEXTJOIN = TEXTJOIN & textn(UBound(textn))
End Function

 

5. Save the workbook as an add-in type (.xlam)

6. Load the add-in into Excel (File ->Options ->Addins)

 

Usage is the same as the real textjoin function except that text1 is also optional.

 

i.e. TEXTJOIN(delimiter, ignore_empty, text1, text2, ...., etc)

 

Regards

 

Murray"

No RepliesBe the first to reply

Resources