VBA convert Excel Style Column Name (with 52 charset) to original number
<p>I have a c++ program that takes an integer and convert it to lower and uppercase alphabets, similar to what excel does to convert column index to column number but also including lower case letters.</p>

<pre><code>#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;climits&gt;
using namespace std;
string ConvertNum(unsigned long v)
{
    char const digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    size_t const base = sizeof(digits) - 1;
    char result[sizeof(unsigned long)*CHAR_BIT + 1];
    char* current = result + sizeof(result);
    *--current = '\0';

    while (v != 0) {
        v--;
        *--current = digits[v % base];
        v /= base;
    }
    return current;
}

// for testing


int main()
{
    cout&lt;&lt; ConvertNum(705);

    return 0;
}
</code></pre>

<p>I need the vba function to reverse this back to the original number. I do not have a lot of experience with C++ so I can not figure out a logic to reverse this in vba. Can anyone please help.</p>

<p><strong>Update 1:</strong> I don't need already written code, just some help in the logic to reverse it. I'll try to convert the logic into code myself.</p>

<p><strong>Update 2:</strong> Base on the wonderful explanation and help provided in the answer, it's clear that the code is not converting the number to a usual base52, it is misleading. So I have changed the function name to eliminate the confusion for future readers.</p>