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.
  • Avatar do usuário
Avatar do usuário
Por annissima
Avatar
#7302
Gente, preciso do seguinte:

Na planilha REGISTRAR, fazer uma validação: se a célula C6 = C7
Se não, mostrar informação de erro.
Se sim, executar uma MsgBox, com confirmação de sim ou não.
Se sim, arquivar o registro, se não, descartar.

If Range.Cells("C6").Value = Range.Cells("C7") Then
If MsgBox("Deseja arquivar este registro?", vbYesNo, "Confirmar!") = vbNo Then Exit Sub

Fiz isso, mas tá com erro.
Não sei muito de VBA, só o extremamente básico.

help!
#7319
Não captei muito bem o que voce pretende fazer após abrir o Msgbox de confirmaçao

De qualquer modo, segue
Código: Selecionar todos
Sub macro()
If [REGISTRAR!C6].Value = [REGISTRAR!C7].Value Then



 vbSimNao = MsgBox("Os valores são iguais. Deseja arquivar?", vbYesNo, "GURU DO EXCEL")

                'se resposta for sim, ele exclui, sai e desmarca
                If vbSimNao = 6 Then
' ESCREVA O QUE DEVE ACONTECER, NO CASO DE SIM

                Else
                  Sheets("REGISTRAR").Select
                        Exit Sub
                End If

Else

 MsgBox "Erro (AS CELULAS NAO POSSUEM MESMO VALOR) !!!" _
    , vbInformation, "Guru do Excel"

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