Jump to content
Wellington Junior

Copia apenas números

Recommended Posts

Wellington Junior

Bom dia pessoal, estou com muito dificuldade em realizar um código no vba, preciso  que me traga apenas os números de uma coluna com número e palavras.

Alguém poderia me ajudar?

Exemplo:

Coluna 1                             Coluna 2

2014                                    2014

carro                                    2014896

2014896                              6598742

moto

6598742

Avião

Share this post


Link to post
Share on other sites
Estuardo
Private Function GetNumbers(s as string) As String
On Error GoTo ErrHandler

Dim s As String
Dim i As Integer

i = VBA.CInt(s)
GetNumbers = i

Exit_Here:
Exit Function

ErrHandler:
GetNumbers = 0
Resume Exit_Here


  
End Function

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.