Página 1 de 1

Acrescentar Uma Rotina na Macro

Enviado: 20 Mai 2021 às 10:18
por Saulo
Bom Dia!
Tenho a macro abaixo funcionando OK.
Do While Range("H4").Value = ""
If Range("H4").Value = "" Then
MsgBox "Favor Escolher Uma Descrição da Peça", 48, "Campo em branco"
flag = 1
End If
If Range("H5").Value <> "" Or Range("H6").Value <> "" Then
MsgBox "Informe a Descrição da Peça", 48, "Campo em branco"
flag = 1
End If
Exit Do

O Pedido de Ajuda
Como Incluir a rotina abaixo na macro acima
Se (“H5”) > (“H6)
MsgBox "Valores Discrepantes", 48, "Campo em branco"
flag = 1
Fim-se

Desde Já Agradeço

Re: Acrescentar Uma Rotina na Macro

Enviado: 20 Mai 2021 às 16:52
por osvaldomp
Olá, Saulo.

Veja se ajuda.
Código: Selecionar todos
   If Range("H4").Value = "" Then
    MsgBox "Favor Escolher Uma Descrição da Peça", 48, "Campo em branco"
    flag = 1
   End If
   If Range("H5").Value <> "" Or Range("H6").Value <> "" Then
    MsgBox "Informe a Descrição da Peça", 48, "Campo em branco"
    flag = 1
   If Range("H5").Value > Range("H6").Value Then
    MsgBox "Valores Discrepantes", 48, "Campo em branco"
    flag = 1
   End If

Re: Acrescentar Uma Rotina na Macro

Enviado: 21 Mai 2021 às 08:54
por Saulo
Bom Dia ! osvaldomp - 20 Mai 2021 às 17:52
Era Isso Mesmo, Funcionou.
Grato