-
Posts
2 -
Cadastrado em
-
Última visita
Tipo de conteúdo
Artigos
Selos
Fabricantes
Livros
Cursos
Análises
Fórum
Tudo que Isaque94 postou
-
Olá, tudo Bem? Estou com uma planilha no qual gostaria de fazer a Seguinte formula: A2=A2+A1 Assim que eu adicionasse um valor numérico na célula A1 a célula A2 somaria com o próprio valor, considerando que o valor inicial de A2 seria 0 Obviamente se eu escrever essa formula não funciona, sei que daria para fazer com VBA porém não sou um entendedor do mesmo Alguém saberia como seria possível aplicar essa formula?
-
Excel Excel travando ao executar macro VBA
Isaque94 respondeu ao tópico de hudsonsaldanha em Microsoft Office e similares
Olá pessoal, Tudo bem resolvi postar aqui pois é o mesmo problema do @hudsonsaldanha, achei desnecessário abrir outro tópico para resolver a mesma situação, perdoem-me se estiver errado. O meu caso o Excel também fica só processando e se eu tentar editar ou adicionar alguma informação dá erro no Excel, como não entendo muito de VBA não sei o que devo melhorar para resolver a situação, se puderem dêem uma olhada pra ver se encontram o problema: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$5" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$B$6" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$E$5" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$E$6" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$B$11" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$B$12" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$E$11" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$E$12" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$B$17" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$B$18" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$E$17" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$E$18" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$B$23" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$B$24" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$E$23" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$E$24" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If If Target.Address = "$B$29" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-1, 0) = Target.Offset(-1, 0) + Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents End If If Target.Address = "$B$30" Then If Not IsEmpty(Target) Then If IsNumeric(Target.Value) Then Target.Offset(-2, 0) = Target.Offset(-2, 0) - Target.Value Else MsgBox "Somente valores numéricos são permitidos!", vbCritical, "Tipos incompatíveis" End If End If Target.ClearContents Target.Select End If End Sub É o mesmo código, um para Soma e outro para Subtração, porém repetido para várias Células Desde Já, Obrigado!
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