Ir ao conteúdo
  • Cadastre-se

Excel Código de VBA para apagar linhas


Ir à solução Resolvido por Visitante,

Posts recomendados

Bom dia Galera!

Preciso substituir esse código na minha planilha, ele apaga as células a baixo de D16, caso D16 seja alterado,

só que eu preciso que apague 15 células abaixo de D16,como eu só sei usar "IF" xD, fiz esse código gigante,

e a planilha da um loading chatinho quando executa essa ação, alguém pode me ajudar a simplifica-lo:

Desde já Obrigado!

Worksheet                           Change

Private Sub Worksheet_Change(ByVal Target As Range)

 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(1, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(2, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(3, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(4, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(5, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(6, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(7, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(8, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(9, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(10, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(11, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(12, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(13, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(14, 0).Value = ""
 If Not Intersect([D16], Target) Is Nothing Then Target.Offset(15, 0).Value = ""

Link para o comentário
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisa ser um usuário para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...