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.
#70536
Mestres, preciso de uma ajuda bem simples para eliminar esta mensagem de erro.

Na planilha anexa, criei um código para que nas células amarelas eu simplesmente digite um número e ele automaticamente seja convertido para a "bolinha" correspondente ao seu número.

A aplicação disso será em uma outra planilha de trabalho que está em desenvolvimento.

O problema é que, quando seleciono um intervalo de duas células ou mais (amarelas) e deleto os valores, me aparece essa mensagem de erro conforme os prints.

Quero poder preencher e deletar livremente (seja por intervalo ou seja por célula individual) sem nenhuma mensagem de erro.

Alguém me ajuda a corrigir isto? Fico no aguardo.
Você não está autorizado a ver ou baixar esse anexo.
#70537
Olá, @Waltricke .

Acrescente a linha em vermelho, conforme abaixo.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub


Segue abaixo um código alternativo ao seu.
Código: Selecionar todos
Private Sub Worksheet_Change(ByVal Target As Range)
 If Target.Count > 1 Then Exit Sub
 If Not Intersect(Target, Range("D4:H4")) Is Nothing And Target.Value >= 1 And Target.Value <= 9 Then
  Target.Value = Cells(Target.Value + 3, 2)
 End If
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