Gleyson 0 Posted January 20 Report Share Posted January 20 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 post Share on other sites
Afonso Mira 1 Posted January 20 Report Share Posted January 20 Olá @Gleyson tudo bem? Vê se é isto que pretendes. If ActiveCell.Value <> "" Then numero = Str(ActiveCell.Value) ActiveCell.Activate ActiveCell.FormulaR1C1 = numero End If Afonso Mira 😃 Estagiando por aqui: Kemet Electronics Portugal, S.A. Link to post Share on other sites
Gleyson 0 Posted January 21 Author Report Share Posted January 21 Meu caro amigo Afonso Mira, agradeço muito a sua informação. Resolveu meu problema e de forma rápida e eficiente. Parabens por sua colaboração neste grupo e a todos que precisam de apoio nas horas mais difícieis com o Excel. Meu muito obrigado. Link to post Share on other sites
Afonso Mira 1 Posted January 21 Report Share Posted January 21 (edited) É um prazer ajudar. Não se esqueça de clicar em obrigado, como forma de agradecimento. Edited January 21 by Afonso Mira Afonso Mira 😃 Estagiando por aqui: Kemet Electronics Portugal, S.A. Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now