Olá pessoal boa noite. Se possivel peço a ajuda de vcs para a solução deste problema.
Nesta planilha formulário preciso que a configuração VBA informe a mensagem de erro somente quando o resultado da céluna G16 for igual a corrigir.
Sub SALVAR()
Dim material As String
Dim status As String
Dim qtde As Integer
material = form_saida.Range("E5").Text
status = form_saida.Range("G16").Text
qtde = var.Range("B2").Value
Application.ScreenUpdating = False
If qtde = 0 Then
MsgBox "Existem dados obrigatórios não preenchidos. Verifique.", vbCritical, "Dados ausentes"
Else
If material <> status Then
MsgBox "Verifique o tipo de material e o status baixa. Divergência foi encontrada.", vbCritical, "Erro"
Else
Sheets("SAÍDAS").Select
Rows("3:5").Select
Selection.EntireRow.Hidden = False
Range("A4:Z4").Select
Selection.Copy
Rows("5:5").Select
Selection.Insert Shift:=xlDown
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Rows("4:4").Select
Selection.EntireRow.Hidden = True
Range("A5").Select
Sheets("FORMULÁRIO SAIDA DE MATERIAL").Select
Range("B5,F5,C7,C13,C16,C18,C20,C22,H22,C24,H24,C26,C28,C30").Select
Range("C30").Activate
Selection.ClearContents
Range("B5").Select
MsgBox "Dados salvos com sucesso.", vbInformation, "Dados gravados"
End If
End If
Application.ScreenUpdating = True
End Sub
CONTROLE_ALMOX_VERSÃO_02_-_Cópia.xls