Jump to content

Como formatar número numa célula ativa?


Gleyson
Go to solution Solved by Afonso Mira,

Recommended Posts

Olá, programadores em Excel VBA. Minha dúvida é como formatar uma célula ativa, sem que seja necessário escolher um período inteiro. A fórmula abaixo mostra isso, mas eu não quero um período inteiro fixo [A1:A10]. Eu preciso apenas que esse comando seja feito somente na célula ativa, independente onde a seleção esteja.

Esse é o comando que preciso mudar:

For Each cell In [A1:A10]
    If cell > "" Then
    numero = Str(cell.Value)
    cell.Activate
    ActiveCell.FormulaR1C1 = numero
    Else
    End If
    Next

 

E aí? Tem como tirar a seleção [A1:A10] e trocar por algo do tipo [Selection]... etc. Por favor, me ajudem.

Link to comment
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.