I've searched around and I know how to call a function from Personal.xlsb from a VB macro, but how can I call the function to be used in a new workbook?
Here's my function, saved in 'Module1' in my Personal.xlsb
:
Public Function GetColumnLetter(colNum As Integer) As String
Dim d As Integer
Dim m As Integer
Dim name As String
d = colNum
name = ""
Do While (d > 0)
m = (d - 1) Mod 26
name = Chr(65 + m) + name
d = Int((d - m) / 26)
Loop
GetColumnLetter= name
End Function
I have created a new workbook and thought I could call that just by =getcolumnletter(1)
, but the function doesn't "populate" when I start typing =...
Am I overlooking something?? How do I use this function in other workbooks, without VBA?
Thanks for any advice!
Ah, it was more simple than I thought. Just use the workbook name before the macro - so
=Personal.xlsb![macroname]
So in my case, I just put this into the cell: =Personal.xlsb!GetColumnLetter(2)
to return "B".