Give this a try. It will be faster than the lookup...
Dim Numero, valor
Dim extenso
Do While Numero = 0
extenso = NumeroToText(Numero)
Public Function NumeroToText(ByVal Numero As Integer) As String
Select Case Numero
Case 0
NumeroToText = "zero"
Case 1
NumeroToText = "um"
Case 2
NumeroToText = "dois"
Case 3
NumeroToText = "tres"
Case 4
NumeroToText = "quatro"
Case 5
NumeroToText = "cinco"
Case Else
NumeroToText = "Error"
End Select
End Function
--
HTH...
Jim Thomlinson
"Joao Vaz" wrote:
Run-time error '1004' - Unable to get the VLookup property of the
WorksheetFunction class. That's the error that I get from VB.
I have a VB program with a VLookup function.
Dim Numero, valor
Dim extenso
Do While Numero = 0
extenso = Application.VLookup(Numero,
Worksheets("Tabelas").Range("R2:S40"), 2)
NUM DESIGN
0 zero
1 um
2 dois
3 tres
4 quatro
5 cinco
This is the Range in the Worksheet Tabelas.
This code works fine until I merge it with the application.
I need some help
Thanks,
Joao