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.
Por Domingsp
Posts
#29548
Bom dia,
tenho a planilha A, que depende dos valores de outra planilha. Na planilha A é executada a macro 1.
Para evitar erros, gostaria de desativar a macro 1 mediante uma condição: enquanto a celula B10 tiver a letra R, a macro 1 estará desativada.
Quando for mudado o conteudo de B10 de R para P, a macro 1 volta é ativada automaticamente.
Código: Selecionar todos
Sub Macro1()
Application.ScreenUpdating = False
   Sheets("Plan A").Select
    Range("AM1:AQ10").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Plan E").Select
    Range("D1").Select
    ActiveSheet.Paste
Application.ScreenUpdating = True
End Sub
#29549
Código: Selecionar todos
sub Teste()
     If sheets("PlanA").range("B10"). value2 = "R" then
               Colocar o código da sua macro aqui
     End if
End sub
#29551
Código: Selecionar todos
Sub Macro1()
 If Sheets("Plan A").[B10] <> "P" Then Exit Sub
  Sheets("Plan A").[AM1:AQ10].Copy Sheets("Plan E").[D1]
End Sub
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