Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
  • Avatar do usuário
Avatar do usuário
Por EversonTiso
Avatar
#5117
Olá a todos!
Encontrei esse código na net para ordenamento de colunas. Se uso a tecla "play" no modulo VBA funciona sempre. Porém, gostaria que ele funcionasse "automaticamente" sem ter que entrar no modo desenvolvedor. Tem como fazer isso?
Desde já agradeço a ajuda.
Abraços a todos.
.....................................................................................................................................

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Worksheets(2).Range("a1:iv86"), Target) Is Nothing) Then
DoSort
End If
End Sub

Private Sub DoSort()
Worksheets(2).Range("a2:iv86").Sort Key1:=Worksheets(2).Range("b2"), Order1:=xlDescending, _
Key2:=Worksheets(2).Range("a2"), Order1:=x1Ascending

End Sub
#5118
Boa tarde!!

Esse evento
Código: Selecionar todos
Worksheet_Change(ByVal Target As Range)
Executa automaticamente, neste caso toda vez que as células
Código: Selecionar todos
Range("a1:iv86")
, sofrer alteração (mas não de formulas).


Att
Avatar do usuário
Por EversonTiso
Avatar
#5154
Alexandre,

Estava usando em um arquivo com Plan1 e Plan2. Onde a VBA atuava na Plan2 sendo que os valores estavam sendo copiados conforme o exemplo =Plan1E2 . Como faço para usar VBA em células com fórmulas? Segue em anexo o arquivo.
Grato pela atenção e ajuda.
Você não está autorizado a ver ou baixar esse anexo.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord