0

I am creating a function to concatenate all cells in a range in a single cell. Everything works ok with the function.

Function transposerange(Rg As Range)
    Dim xCell As Range
    Dim xStr As String
    For Each xCell In Rg
        If Not IsEmpty(xCell.Value) Then
            xStr = xStr & xCell.Value & " "
        End If
    Next
    transposerange = Left(xStr, Len(xStr) - 1)
End Function

If I save it in the opened workbook, I can call it from excel. If I save this function to my personal workbook, it doesn't appear in excel when I want to call it.

What am I doing wrong?

3
  • 2
    Have you saved your personal workbook as a macro enabled workbook? Commented Nov 6, 2017 at 10:41
  • File should be .xlsm or .xlsb to save VBA code Commented Nov 6, 2017 at 10:47
  • i don't think so, i see that it's called personal.xlsb. How do I change the file from .xlsb to .xlsm because I can't find it in %appdata%? Commented Nov 6, 2017 at 10:48

1 Answer 1

1

If you want use this function in your spreadsheets, type Personal.xlsb!transposerange(somerange). If you want just transposerange you must make add-id comprising this UDF.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.