Olá,
Sou novo no fórum e iniciante em VBA, estou precisando de algo bastante simples, preciso criar um código que procure valores negativos em uma determinada coluna.
Quem puder ajudar agradeço!
Abraços.
Vídeo recomendado
https://youtu.be/diWPPPhW-9E
https://youtu.be/diWPPPhW-9E
Procurar valor negativo!
- Mauro Coutinho
- Jedi
- Mensagens: 1561
- Registrado em: Sáb Mar 13, 2010 8:10 pm
- Localização: São José dos Pinhais - Pr
Re: Procurar valor negativo!
Veja se é isto, só ajuste a Coluna a verificar :
Código: Selecionar todos
Sub Find_Negativos()
Dim sRg As Range
Dim sValor
Dim sUltLin As Long
sUltLin = Sheets("Plan1").Range("A" & Rows.Count).End(xlUp).Row
Set sRg = Range("A2" & ":" & "A" & sUltLin)
For Each x In sRg
If x < 0 Then
MsgBox "O Valor :- " & x & " é Negativo"
End If
Next x
End Sub