8

I am writing a simple function, such as:

Function myFunction() As Variant
    'Some rules
End Function

For the above function, is it possible to assign an Alias like you can do with API calls?

Obviously this isn't the proper syntax, but you get the idea:

Function myFunction() Alias myFunc As Variant
    'Some rules
End Function

This would allow me to use either name:

Sub Test()
    Debug.Print myFunction
    Debug.Print myFunc
End Sub
ashleedawg
  • 17,207
  • 5
  • 53
  • 80
  • 2
    I believe this has been asked previously [here](https://stackoverflow.com/questions/4312447/define-a-function-alias-in-vba-possible). – Lee Mac Jan 21 '18 at 13:02
  • @TheNotSoGuru, I added an completely new answer based on so called *`SoundEx` search* as you slightly modified your *initial question (cf. comment as of 1/22)* and in order to allow a clear view over an independant and maybe innovative approach to get function names. – T.M. Feb 03 '18 at 18:15

3 Answers3

24

I don't understand why you would need to have a VBA alias for an VBA function.

API Aliases are for referring to a function or other object in a DLL, if it's "given name" can't be used in the module that requires it.

Alias —— Indicates that the procedure being called has another name in the DLL. This is useful when the external procedure name is the same as a keyword. You can also use Alias when a DLL procedure has the same name as a public variable, constant, or any other procedure in the same scope. Alias is also useful if any characters in the DLL procedure name aren't allowed by the DLL naming convention. (Source)

...but to answer your question, sure you could create alternate name for a function, with only a slight modification to your code:


Your Function:

Function myFunction() As Variant
    'Some rules
End Function

Assign an alternate name:

Function myFunc() As Variant
   myFunc = myFunction
End Function

This would allow you to use either name:

Sub Test()
    Debug.Print myFunction
    Debug.Print myFunc
End Sub

EDIT: "Can't remember UDF Names"

(When I said I didn't understand why you needed to do this, I assumed you didn't have a memory like mine! Now I understand your reasoning, giving multiple names to the same function!)

What, haven't you memorized the name and syntax of all your custom VBA functions yet, on top of the 1000's of built-in functions, procedures and objects, and the seemingly unlimited list of property, method, and class names??

Me neither.

A feature that helps trigger my memory when coding in VBA is the List of Properties/Methods.

Start typing the name of a function or procedure and hit Ctrl+J, and you'll get a list of custom and built-in functions, methods, procedures, etc.**

Ctrl+J exanmple

I noticed that your sample function names all started with "my". That may have been just for illustrative purposes, however, a specific naming convention like that would also help by grouping your functions together in the Properties/Methods Dialog Box.


More ways to remember How things work and what they're called:

You can also add a description to a UDF (User-Defined Function), which would appear when entering the function name on a worksheet:

UDF Descr screenshot

See: How to put a 'Tooltip' on a user-defined function


Related:


Taking it a step further than the description, Registering the User-Defined Function allows not only the creation of a description for the function, but also detailed information about each of the function's parameters and their data types; you can even specify Shortcut Key(s), add links to custom "Help" files/pages, and even assign a Category for the UDF.

These extended attributes display in the Insert Function dialog , accessible by clicking the 'FX' button to the left of the formula bar button to the left of the formula bar, or by hitting Shift+F3:

Insert Function dialog

Excel doesn't have a built-in interface for editing parameter descriptions so VBA is required. Relevant documentation can be hard to locate.


Code & Info about Registering User-Defined Functions -:


Create a ribbon button to list VBA Procedures

I haven't tried this but I can see how it could be very handy, especially since it would be easy to customize further, perhaps with project-specific function lists and other information.

A button can be added to the ribbon, that when clicked displays a list of VBA procedures/functions, using XML and VBA to display a user form from a button. There's also an option to save the list of procedures to a text file.

Image from: https://i-msdn.sec.s-msft.com/dynimg/IC297331.jpg

You can already see the procedures in a workbook from the Macros button on the Developers tab. However, only parameter-less subroutines in modules and within a worksheet are displayed in the Macros dialog box. Functions and subroutines with parameters do not show up. The code described in this column displays all of the subroutines and functions in the workbook.

More information and complete code is available here.


VBA Code that writes VBA Code!?

By programmatically manipulating the VBA Editor (VBE), you can write code in VBA that reads or modifies other VBA projects, modules and procedures, and could be used to automate development-related tasks. This is called extensibility because it extends the editor -- you can use VBA code to create new VBA code. You can use these features to write custom procedures that create, change, or delete VBA modules and code procedures.

The amazing Chip Pearson has done it again, with detailed instructions and complete code available here for some of the fun things extensibility can do for you.

A partial list of code on Chip's page (which is here):

  • Add/Delete/Rename a Module in a Project
  • Add/Delete/Rename a Procedure in a Module
  • Copy Modules Between Projects
  • Create a New Procedure in a Code Module
  • Create an Event Procedure
  • Listing all Procedures in a Module
  • Read a Procedure Declaration
  • Search a Module For Text
  • Fix Screen Flicker in the VBE
  • Export a VBComponent to a Text File
  • Test if a VBComponent Exists
  • Determine the Workbook Associated with a VBProject
  • Count lines of code in Module/Project/Component

The methods use the VBA Extensibility [library] (http://www.exceltoolset.com/setting-a-reference-to-the-vba-extensibility-library-by-code/) (reference) and require programmatic access to the VBA Project, which is a security setting in Excel's options. See Chip's page for more info.

Chip's pages also have great information and code available on Customizing Menus with VBA, which could have benefit in making the developer's own job easier.


A seemingly "forgotten" ability of VBA if functionality to control and even intercept built-in commands. This could also be used to benefit the developer (especially one with a poor memory!)... More information and examples from Microsoft here.


QHarr
  • 72,711
  • 10
  • 44
  • 81
ashleedawg
  • 17,207
  • 5
  • 53
  • 80
  • good answer - with possible disadvantage of many functions instead of one where I know where I have to look at (let aside a class approach). So it think it's up to the user. – T.M. Jan 21 '18 at 18:48
  • I think this is probably as close as I will get to what I am wanting. In a project where I may create many functions I may not remember if I named a function `verifyRange` vs `verifyRng`. If it comes down to it I suppose I can create a module just for aliases. –  Jan 22 '18 at 07:20
  • 1
    *Ah I see now* - the ***memory*** issue - that makes more sense. When I said I didn't understand why you needed to do this, I assumed you didn't have a memory like mine! This I can totally relate to. Generally my solution is whiteboards all over my work area. :-) – ashleedawg Jan 22 '18 at 07:49
  • I just remembered a keyboard shortcut that just might become your favorite. I will edit my answer to demonstrate. – ashleedawg Jan 22 '18 at 08:00
  • 3
    @TheNotSoGuru Why not use a consistent naming convention? This alias-based approach is likely to be a debugging headache sooner or later. – John Coleman Jan 22 '18 at 11:43
  • @ashleedawg I really appreciate the extended answer! Thanks for that! Glad I was able to clear some things up too :D –  Jan 22 '18 at 14:33
  • 2
    @TheNotSoGuru As John Coleman notes, the solution to your memory issue is just maintaining a consistent naming convention. All functions should have descriptive names, and they should be verbs (such as verify, get, pull, etc.). I find 'Get' to be the most useful for functions that return something. I also highly recommend names that don't use abbreviations (So VerifyRange over VerifyRng), but this is personal preference. Consistent names will go much father than aliasing. – Brandon Barney Jan 22 '18 at 15:11
  • This over-the-top awesome examplary answer will be earning a bounty as soon as the question is eligible for one. Keep them coming! – Mathieu Guindon Jan 22 '18 at 15:13
  • @Mat'sMug Not sure if you still wanted to give ashleedawg her bounty xD –  Feb 01 '18 at 01:17
  • 2
    Another useful memory aid is to put related functions together in different modules and rename your modules - I nearly always have a module named G for global variables, one named DB for database connections and functions, one Util for utility functions. Then type the name of the module followed by dot, and all the public functions in that module are listed automatically, just like a class module. – JohnRC Feb 02 '18 at 16:25
  • 1
    @QHarr — *ain't it handy?!* It's [ScreenToGif](http://www.screentogif.com/). If *"a picture says 1000 words"*, then how many words does an animated GIF say, when trying to explain something technical? ...plus I keep finding new uses for it outside of here; so much that I felt obligated to donate to the developer... – ashleedawg Feb 10 '18 at 13:41
  • 1
    @ashleedawg Thanks. I had been told and forgot. Thanks for the reminder. – QHarr Feb 10 '18 at 13:53
  • @QHarr — np, least I can do for the *["13th place Excel/VBA Question Answer'er of the Year"](https://data.stackexchange.com/stackoverflow/query/800909/top-vba-excel-answerers-this-year#resultSets)* [out of 1662...] ...not that it's a competition! ☺ – ashleedawg Feb 10 '18 at 14:21
  • What???? And there I was worrying cos so busy at work I haven’t been able to answer questions. Then was scanning through your answers to learn some new stuff as was worried I was falling behind the curve! – QHarr Feb 10 '18 at 14:24
  • No way, I'm trying to catch up to you. Maybe you *should* focus on your work more... ☺ – ashleedawg Feb 10 '18 at 14:25
  • I think you will probably overtake me quite soon at this rate. #Notpayingattentiontoyourscore – QHarr Feb 10 '18 at 14:31
  • @QHarr — Don't sweat it, we're pretty much *"neck-and-neck"* anyhow, and besides, I suspect I have more free time on my hands than you do. *...and [here's proof of **both** those theories](http://jmp.sh/ovQ28Ef)!* (*and of course, the* [Source](https://data.stackexchange.com/stackoverflow/query/801361/#resultSets)) ...haha – ashleedawg Feb 10 '18 at 16:38
  • This basically says you are kicking my a*! :-) And people like to look at you more :-( – QHarr Feb 10 '18 at 16:42
  • No, this says I just wasted an hour and need to get a life! – ashleedawg Feb 10 '18 at 16:43
  • Lol. I forgot you could query SO. I suspect that will be some of my life gone shortly. I only started answering questions in September and I enjoy it but as you can see, when work gets busy, I switch to asking questions.... – QHarr Feb 10 '18 at 16:45
  • You & I combined answered 3 questions prior to September, and **470** since September (with a 50½/49½% split). I call that pretty damn close (and I figure the community's the *real* winner in this game!) – ashleedawg Feb 10 '18 at 17:00
1

Simple VBA example (no classes)

As you are calling yourself TheNotSoGuru, try the following relative simple approach: Instead of an API like alias definition you would have to write your alias definitions in ONE user defined alias() function.

Calling test procedure

This shows you how to call your aliases using ONE user defined alias function; the first argument is your alias Name as string, other arguments define possible arguments of the original functions themselves:

Option Explicit     ' declaration head of your code module

Sub Test()
Debug.Print "0) Original Function", myFunction
Debug.Print "1) alias(""(myFunc1"")", alias("myFunc1")
Debug.Print "2) alias(""(myFunc2"")", alias("myFunc2")      ' too less arguments
Debug.Print "2) alias(""(myFunc2"",false)", alias("myFunc2", False)
End Sub

Example functions

The first example needs no argument; the second example demonstrates an incorrect as well as a correct alias function call - the original function attends the input of a boolean argument (True or False).

Function myFunction() As Variant
'Some rules
'...
'return result
 myFunction = "Result from myFunction"
End Function

Function myFunctionWithOneArgument(Optional ByVal b As Boolean = True) As String
'Some rules
If b Then
   myFunctionWithOneArgument = "result from myFunctionWithOneArgument " & "okay"
Else
   myFunctionWithOneArgument = "result from myFunctionWithOneArgument " & "without comment"
End If
End Function

=============== Example of an Alias() function

You are responsible to insert your alias definitions into the alias function. It allows you even to force inputs of the correct number of arguments by raising a 450 error "Wrong number of arguments ..." via error handling. If an error occurs a messagebox displays an error message.

Function alias(ByVal sFunc, Optional arg1, Optional arg2, Optional arg3)
On Error GoTo oops           ' error handler
Select Case sFunc & ""       ' check your own aliases as string values 
  Case "myFunc1", "1"        ' your alias Definition(s)
       alias = myFunction    ' return original function myFunction
  Case "myFunc2", "One"      ' see above
       ' defines if one argument is needed here:
       If IsMissing(arg1) Then Err.Raise (450)   ' too less arguments if arg1 is missing
       alias = myFunctionWithOneArgument(arg1)
  Case Else
       alias = "Unknown function alias " & sFunc
End Select
EverythingOkay:     Exit Function

oops:
MsgBox "Function: " & sFunc & vbNewLine & vbNewLine & _
       "Error No: " & Err.Number & vbNewLine & _
       Err.Description, vbExclamation, "Error - Wrong number of arguments"
Err.Clear
End Function
T.M.
  • 6,659
  • 3
  • 24
  • 42
  • 1
    I appreciate the response. The issue is not that I necessarily want to call out the alias intentionally, it's an issue of forgetting what I many have named a function to begin with (ie. `verifyRange` vs `verifyRng`). If I knew I was calling the alias name to begin with then I wouldn't need to call the alias. But your solution does work and it was very well thought out. +1 –  Jan 22 '18 at 07:23
0

Searching Aliases via Similarity

A) Intro

Your Comment as of 1/22: "The issue is not that I necessarily want to call out the alias intentionally, it's an issue of forgetting what I may have named a function to begin with (ie. verifyRange vs verifyRng). If I knew I was calling the alias name to begin with then I wouldn't need to call the alias. But your solution does work and it was very well thought out."

Due to your example in above cited comment: As you slightly modified your initial question, I thought about an alternative solution and added it as an independant new answer:

► You could take some advantage of using a so called SoundEx search to group procedure names based on a phonetic algorithm.

Method: A Soundex code identifies a set of similar sounding terms, names or ... ► procedure names. If you combine this with a loop through a VBIDE list of all existing procedures/functions (don't forget to set a reference) you are able to get the most likely alias(es) listed.

Example result

1/1 Project(s): "VBAProject" (D:\Excel\test.xlsm)
**Project name: "VBAProject" ** (Host Project)
++SoundEx("verifyRange")="V616"
--   Found --  Procedure/Function name(s) ---------  ------------------
[Prc: Sub]     verifyRng   in Std Module modTest1    Line#: 2/[Body: 3]
[Prc: Sub]     verifyRange in Std Module modSortDict Line#: 6/[Body: 6]

Note: This method builds a condensed alphanumeric code based on the six phonetic classifications of human speech sounds (bilabial, labiodental, dental, alveolar, velar, and glottal), removing vocals and some occurences of 'H','W' and 'Y'; the code consists of the first capitalized letter and three following digits (filled with 0 if no more consonants found) . BTW origins date back to the late 1800's used for indexing American census records.

Links

Find the word which I closest to the particular string? http://www.creativyst.com/Doc/Articles/SoundEx1/SoundEx1.htm#JavaScriptCode https://en.wikipedia.org/wiki/Soundex

Soundex Example

To demonstrate the soundex coding, try the following example call with identical results:

Sub testSoundEx()
Dim i As Integer
Dim a()
a = Array("verifyRange", "verifyRng", "vrfRanges")
Debug.Print "Proc name", "SoundEx Code": Debug.Print String(50, "-")
For i = LBound(a) To UBound(a)
    Debug.Print a(i), SoundEx(a(i))
Next i
End Sub

SoundEx Function

Function SoundEx(ByVal s As String) As String
' Site:   https://stackoverflow.com/questions/19237795/find-the-word-which-i-closest-to-the-particular-string/19239560#19239560
' Source: Developed by Richard J. Yanco
' Method: follows the Soundex rules given at http://home.utah-inter.net/kinsearch/Soundex.html
Dim Result As String, c As String * 1
Dim Location As Integer
s = UCase(s)                ' use upper case
' First character must be a letter
If Len(Trim(s)) = 0 Then
   Exit Function
ElseIf Asc(Left(s, 1)) < 65 Or Asc(Left(s, 1)) > 90 Then
    SoundEx = ""
    Exit Function
Else
  ' (1) Convert to Soundex: letters to their appropriate digit,
    '             A,E,I,O,U,Y ("slash letters") to slashes
    '             H,W, and everything else to zero-length string
    Result = Left(s, 1)
    For Location = 2 To Len(s)
        Result = Result & Category(Mid(s, Location, 1))
    Next Location
  ' (2) Remove double letters
    Location = 2
    Do While Location < Len(Result)
        If Mid(Result, Location, 1) = Mid(Result, Location + 1, 1) Then
            Result = Left(Result, Location) & Mid(Result, Location + 2)
        Else
            Location = Location + 1
        End If
    Loop
   ' (3) If category of 1st letter equals 2nd character, remove 2nd character
    If Category(Left(Result, 1)) = Mid(Result, 2, 1) Then
        Result = Left(Result, 1) & Mid(Result, 3)
    End If
   ' (4) Remove slashes
    For Location = 2 To Len(Result)
        If Mid(Result, Location, 1) = "/" Then
            Result = Left(Result, Location - 1) & Mid(Result, Location + 1)
        End If
    Next
   ' (5) Trim or pad with zeroes as necessary
    Select Case Len(Result)
        Case 4
            SoundEx = Result
        Case Is < 4
            SoundEx = Result & String(4 - Len(Result), "0")
        Case Is > 4
            SoundEx = Left(Result, 4)
    End Select
End If
End Function

Helper function called by SoundEx()

This helper function returns a letter code based on phonetic classifications (see notes above):

Private Function Category(c) As String
'   Returns a Soundex code for a letter
Select Case True
    Case c Like "[AEIOUY]"
        Category = "/"
    Case c Like "[BPFV]"
        Category = "1"
    Case c Like "[CSKGJQXZ]"
        Category = "2"
    Case c Like "[DT]"
        Category = "3"
    Case c = "L"
        Category = "4"
    Case c Like "[MN]"
        Category = "5"
    Case c = "R"
        Category = "6"
    Case Else 'This includes H and W, spaces, punctuation, etc.
        Category = ""
End Select
End Function

► Solution to your issue - Example Call to get Functions by Alias

B) Memory issue or how to jog one's memory

You can use the following example call to search for procedure/function aliases via Syntax listProc {function name string}, e.g. listProc "verifyRange" and you get a condensed list of all found aliases in the Immediate Window of your Visual Basic Editor (VBE):

Sub Test()
listProc "verifyRange"  ' possibly gets verifyRange AND verifyRng via SoundEx "V616"
'listProc "verify"      ' possibly gets nothing, as SoundEx "V610" has no fourth consonant
'listProc                '[ displays ALL procedures without SoundEx Filter ]
End Sub

Note: Keep in mind that the SoundEx Code (e.g. "V616" for verifyRange) is limited to a length of four alphanumeric characters. If you are looking for "verify" only (= 3 consonants V+r+f), you would get "V610" instead without findings of "verifyRange" or "verifyRng" (V+r+f+r). In this case you should search for a pair of variants.

============================= Main procedure listProc =====================

Sub listProc(Optional ByVal sFuncName As String)
' Purpose: display procedures using a SoundEx Filter
' Call:   0 arguments or empty argument - ALL procedures without filter
'         1 argument (not empty)        - procedures found via SoundEx
' Note:   requires reference to Microsoft Visual Basic for Applications Extensibility 5.3
' Declare variables to access the macros in the workbook.
Dim VBAEditor      As VBIDE.VBE         ' VBE
Dim objProject     As VBIDE.VBProject   ' Projekt
Dim objComponent   As VBIDE.VBComponent ' Modul
Dim objCode        As VBIDE.CodeModule  ' Codeblock des Moduls
' Declare other miscellaneous variables.
Dim sProcName      As String
Dim sndx As String, sndx2 As String
Dim pk             As vbext_ProcKind       ' proc kind (Sub, Function, Get, Let)
Dim strPK          As String, sTyp As String
Dim iLine          As Integer, iBodyLine As Integer, iStartLine As Integer
Dim i              As Integer
Dim bShow          As Boolean             ' show procedure name
Dim bSoundEx       As Boolean
If Len(Trim(sFuncName)) > 0 Then bSoundEx = True  ' show alle procedures!
' ========================================
' Get the project details in the workbook.
' ========================================
  Set VBAEditor = Application.VBE

  Set objProject = VBAEditor.ActiveVBProject
' Set objProject = VBAEditor.VBProjects("MyProcject")   ' 1-based, project name or item number

 For i = 1 To VBAEditor.VBProjects.Count    ' show name, filename, buildfilename (DLL)
     Debug.Print i & "/" & _
                 VBAEditor.VBProjects.Count & " Project(s): """ & _
                 VBAEditor.VBProjects(i).Name & """ (" & VBAEditor.VBProjects(i).filename & ")"
 Next i
' get SoundEx of Function name
  sndx2 = SoundEx(sFuncName)
' ==================
' ? PROJECT NAME
' ==================
'   objProject.Type ...vbext_pt_HostProject 100 Host-Project
'                   ...vbext_pt_StandAlone  101 Standalone-Project
  Debug.Print "**Project name: """ & objProject.Name & """ ** (" & _
              IIf(objProject.Type = 100, "Host Project", "Standalone") & ")"
  If bSoundEx Then Debug.Print "++SoundEx(""" & sFuncName & """)=""" & sndx2 & """" & _
                               vbNewLine & "--   Found --  Procedure/Function name(s)"

' Iterate through each component (= Module) in the project.
For Each objComponent In objProject.VBComponents        ' alle MODULE
    ' Find the code module for the project (Codeblock in current component/=module).
      Set objCode = objComponent.CodeModule
      ' =============
      ' ? MODULE NAME
      ' =============
      If objCode.CountOfLines > 0 And Not bSoundEx Then
         Debug.Print " *** " & _
             sModType(objComponent.Type) & " ** " & objComponent.Name & " ** "
      End If
  ' Scan through the code module, looking for procedures.
  ' Durch alle Codezeilen des jeweiligen Moduls gehen
    iLine = 1
    Do While iLine < objCode.CountOfLines               ' alle Zeilen durchackern (1/End ...)

      ' =================
      ' Get Procedurename                               ' !! SETZT AUTOMATISCH >> pk << !!
      ' =================
        sProcName = objCode.ProcOfLine(iLine, pk)       ' jede nächste Zeile auf Prozedurbeginn checken

        If sProcName <> "" Then                         ' ohne Declaration head
            ' -----------------
            ' Found a procedure
            ' -----------------
            ' a) Get its details, and ...
              strPK = pk                                 ' 0-Prc|1-Let/2-Set/3-Get Werte abfangen !!!
           '' iStartLine = objCode.ProcStartLine(sProcName, strPK)  ' here = iLine !!
              iBodyLine = objCode.ProcBodyLine(sProcName, strPK)    ' Zeilennr mit Sub/Function/L/S/Get
              sTyp = sPrcType(objCode.Lines(iBodyLine, 1))          ' Sub|Fct|Prp
            ' b) Check Soundex
              If bSoundEx Then
                 sndx = SoundEx(sProcName)
                 If sndx = sndx2 Or UCase(sProcName) = UCase(sFuncName) Then
                    bShow = True
                 Else
                    bShow = False
                 End If
              Else
                 bShow = True
              End If
              ' ==============
              ' c) ? PROC NAME
              ' --------------
              If bShow Then
                 Debug.Print "    " & "[" & sPK(strPK) & ": " & sTyp & "] " & _
                          sProcName & IIf(bSoundEx, " in " & sModType(objComponent.Type) & " " & objComponent.Name, "") & vbTab, _
                          "Line#: " & iLine & "/[Body: " & iBodyLine & "]"
              End If
            ' -------------------------------------------
            ' d) Skip to the end of the procedure !
            '    => Add line count to current line number
            ' -------------------------------------------
              iLine = iLine + objCode.ProcCountLines(sProcName, pk)
        Else
            ' This line has no procedure, so => go to the next line.
            iLine = iLine + 1
        End If
    Loop

Next objComponent

' Clean up and exit.
  Set objCode = Nothing
  Set objComponent = Nothing
  Set objProject = Nothing


End Sub

3 Helper Functions to the Main procedure listProc

These helper functions return additional information to procedures and module:

Function sPK(ByVal prockind As Long) As String
' Purpose: returns short description of procedure kind (cf ProcOfLine arguments)
Dim a(): a = Array("Prc", "Let", "Set", "Get")
sPK = a(prockind)
End Function

Function sPrcType(ByVal sLine As String) As String
' Purpose: returns procedure type abbreviation
If InStr(sLine, "Sub ") > 0 Then
   sPrcType = "Sub"     ' sub
ElseIf InStr(sLine, "Function ") > 0 Then
   sPrcType = "Fct"     ' function
Else
    sPrcType = "Prp"    ' property (Let/Set/Get)
End If
End Function

Function sModType(ByVal moduletype As Integer) As String
' Purpose: returns abbreviated module type description
Select Case moduletype
   Case 100
     sModType = "Tab Module"
   Case 1
     sModType = "Std Module"
   Case 2
     sModType = "CLS Module"
   Case 3
     sModType = "Frm Module"
   Case Else
     sModType = "?"
 End Select
End Function
T.M.
  • 6,659
  • 3
  • 24
  • 42
  • @TheNotSoGuru, did you try my second approach ("memory" issue/distinguishing between `verifyRange` and possible aliases, e.g. `verifyRng`) via `SoundEx` method - would appreciate a short feedback as I invested some research time in this idea :-) – T.M. Feb 07 '18 at 18:31