G
Guest
I have created the following function:
Public Function Convert_Column_Values_Str_to_Int(ColumnValueStr)
'
' Convert_Column_Values_Str_to_Int Macro
' Macro recorded 2006-07-18 by ervbb
'
'
********************************************************************************
' This macro convert the column value on format A..Z, AA..AZ, BA..BZ, ...
' to format 1..26, 27..52, 53..78, ... .
'
********************************************************************************
'
ColumnValueInt = 0
If Len(ColumnValueStr) = 1 Then
ColumnValueInt = Asc(ColumnValueStr) - 64
Else
ColumnValueInt = (Asc(Left(ColumnValueStr, 1)) - 64) * 26 +
Asc(Right(ColumnValueStr, 1)) - 64
End If
' Set the function value
Convert_Column_Values_Str_to_Int = ColumnValueInt
End Function
and stored it in an .xla file on C:\Document and Settings\ervbb\Applivation
Data\Microsoft\AddIns. I have installed it by marking it in Tools/AddIns and
restarted Excel. But when I try to call it from my VB-macro I've get the
following error message from Microsoft Visual Basic: "Compile error: Sub or
Function not defined."
What is wrong/missing?
BR Bengt
Public Function Convert_Column_Values_Str_to_Int(ColumnValueStr)
'
' Convert_Column_Values_Str_to_Int Macro
' Macro recorded 2006-07-18 by ervbb
'
'
********************************************************************************
' This macro convert the column value on format A..Z, AA..AZ, BA..BZ, ...
' to format 1..26, 27..52, 53..78, ... .
'
********************************************************************************
'
ColumnValueInt = 0
If Len(ColumnValueStr) = 1 Then
ColumnValueInt = Asc(ColumnValueStr) - 64
Else
ColumnValueInt = (Asc(Left(ColumnValueStr, 1)) - 64) * 26 +
Asc(Right(ColumnValueStr, 1)) - 64
End If
' Set the function value
Convert_Column_Values_Str_to_Int = ColumnValueInt
End Function
and stored it in an .xla file on C:\Document and Settings\ervbb\Applivation
Data\Microsoft\AddIns. I have installed it by marking it in Tools/AddIns and
restarted Excel. But when I try to call it from my VB-macro I've get the
following error message from Microsoft Visual Basic: "Compile error: Sub or
Function not defined."
What is wrong/missing?
BR Bengt