Article ID: 213392 - View products that this article applies to.
This article was previously published under Q213392
This article has been archived. It is offered "as is" and will no longer be updated.
This article contains a sample Microsoft Visual Basic for Applications function that converts an integer number to any base less than 10.
The following function is a sample function called "baseconv" that takes two arguments. The first argument, InputNum, is an integer number to be converted. The second argument, BaseNum, is the number of the base to convert InputNum to.
Sample Visual Basic Procedure
The function should be typed in a worksheet cell as follows:
For example, the following call to the baseconv function
returns the following value in the cell:
For more information about creating function procedures in Microsoft Excel, click Microsoft Visual Basic Help on the Help menu, type Writing a Function Procedure in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
To access Visual Basic Help: