Escola Saberexcel VBA Estudos® – Treinamentos com Macros, Fórmulas e Funções
CADASTRANDO DADOS EM OUTRA FOLHA DE PLANILHA COM EXCEL VBA.
![](https://escola.saberexcel.com.br/wp-content/uploads/2014/06/excel-planilha-treinamento-vba-videos-300x183.png)
PROMOÇÃO ESPECIAL – EXCEL VBA Adquirir o Material Didático Escola SaberExcel VBA Estudos
Planilha Excel VBA cadastrar Monitorias IRD Fixa Com esse Macro do Aplicativo Microsoft Excel VBA(Visual Basic Application), vamos fazer um cadastro a partir de uma folha de planilha onde será digitado os dados em algumas células predefinidas, que serão automaticamente lançadas em outra folha de planilha (Lançamentos), observe que o macro localizará a ultima linha para inserção de novos dados,
Também fiz algumas linhas de códigos para verificar a inconsistencia, isto é se a célula do cadastro estiver em branco, emitirá uma mensagem, selecionará a linha para que a preencha, tudos os dados preenchidos execute o macro e o lançamento será realizado em outra folha de planilha.
(***) (dois pontos ‘:‘ nos códigos significa “proxima linha, linha debaixo.)
Desejo a todos paz e saúde sempre!
Seja um Assinante Escola Saberexcel VBA Estudos®
Procedimentos de Aquisição do Material Didaticos SaberExcel
Sub cadastrar_lancamentos()
Dim X As Integer
‘//= verificar inconsistencia.
If Plan1.Cells(6, “b”) = “” Then MsgBox “Preencha a célula Nome do Agente”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.[b6].Select: Exit Sub
If Plan1.Cells(7, “b”) = “” Then MsgBox “Preencha a célula Registro do Agente”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.[b7].Select: Exit Sub
If Plan1.Cells(6, “e”) = “” Then MsgBox “Preencha a Gestor que realizou “, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.[e6].Select: Exit Sub
If Plan1.Cells(7, “e”) = “” Then MsgBox “Preencha adata da monitoria”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(7, “e”).Select: Exit Sub
If Plan1.Cells(10, “b”) = “” Then MsgBox “Preencha adata da chamada”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(10, “b”).Select: Exit Sub
If Plan1.Cells(11, “b”) = “” Then MsgBox “Preencha hora da chamada”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(11, “b”).Select: Exit Sub
If Plan1.Cells(12, “b”) = “” Then MsgBox “Preencha duração da chamada”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(12, “b”).Select: Exit Sub
If Plan1.Cells(13, “b”) = “” Then MsgBox “Preencha cliente telefone”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(13, “b”).Select: Exit Sub
If Plan1.Cells(16, “b”) = “” Then MsgBox “Preencha atendeu em 5 minutos”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(16, “b”).Select: Exit Sub
If Plan1.Cells(17, “b”) = “” Then MsgBox “Preencha solicitou telefone por callback”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(17, “b”).Select: Exit Sub
If Plan1.Cells(18, “b”) = “” Then MsgBox “Preencha informou protocolo”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(18, “b”).Select: Exit Sub
If Plan1.Cells(21, “b”) = “” Then MsgBox “Preencha Atendeu solicitação do cliente?”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(21, “b”).Select: Exit Sub
If Plan1.Cells(22, “b”) = “” Then MsgBox “Preencha houve acionamento via email”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(22, “b”).Select: Exit Sub
If Plan1.Cells(23, “b”) = “” Then MsgBox “Preencha houve necessidade de atendidmento diferenciado”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(23, “b”).Select: Exit Sub
If Plan1.Cells(24, “b”) = “” Then MsgBox “Preencha Cliente acionou Anatel/Procon?”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(24, “b”).Select: Exit Sub
If Plan1.Cells(27, “b”) = “” Then MsgBox “Preencha palpitou chamada ?”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(27, “b”).Select: Exit Sub
If Plan1.Cells(28, “b”) = “” Then MsgBox “Preencha teve cortesia”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(28, “b”).Select: Exit Sub
If Plan1.Cells(29, “b”) = “” Then MsgBox “Tom de voz adequado?”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(29, “b”).Select: Exit Sub
If Plan1.Cells(30, “b”) = “” Then MsgBox “Referencial foi adequado?”, vbInformation, “Escola Saberexcel VBA Estudos®”: Plan1.Cells(30, “b”).Select: Exit Sub
‘if Plan1.Cells(32, “b”) = “” ‘Observações
‘//======’ realizando os lançamentos se estiverem todos preenchidos.!
X = Plan2.Cells(Rows.Count, “A”).End(xlUp).Row + 1
Plan2.Cells(X, “a”).Value = Plan1.Cells(6, “b”)
Plan2.Cells(X, “b”).Value = Plan1.Cells(7, “b”)
Plan2.Cells(X, “c”).Value = Plan1.Cells(6, “e”)
Plan2.Cells(X, “d”).Value = Plan1.Cells(7, “e”) ‘data da monitoria
Plan2.Cells(X, “e”).Value = Plan1.Cells(10, “b”) ‘data da chamada’
Plan2.Cells(X, “f”).Value = Plan1.Cells(11, “b”) ‘hora da chamada’
Plan2.Cells(X, “g”).Value = Plan1.Cells(12, “b”) ‘duração da chamada
Plan2.Cells(X, “h”).Value = Plan1.Cells(13, “b”) ‘cliente telefone
Plan2.Cells(X, “i”).Value = Plan1.Cells(16, “b”) ‘atendeu em 5 minutos’
Plan2.Cells(X, “j”).Value = Plan1.Cells(17, “b”) ‘solicitou telefone por callback
Plan2.Cells(X, “k”).Value = Plan1.Cells(18, “b”) ‘informou protocolo
Plan2.Cells(X, “L”).Value = Plan1.Cells(21, “b”) ‘Atendeu solicitação do cliente?
Plan2.Cells(X, “M”).Value = Plan1.Cells(22, “b”) ‘houve acionamento via email
Plan2.Cells(X, “n”).Value = Plan1.Cells(23, “b”) ‘houve necessidade de atendidmento diferenciado
Plan2.Cells(X, “o”).Value = Plan1.Cells(24, “b”) ‘Cliente acionou Anatel/Procon?
Plan2.Cells(X, “p”).Value = Plan1.Cells(27, “b”) ‘palpitou chamada ?
Plan2.Cells(X, “q”).Value = Plan1.Cells(28, “b”) ‘teve cortesia
Plan2.Cells(X, “r”).Value = Plan1.Cells(29, “b”) ‘Tom de voz adequado?
Plan2.Cells(X, “s”).Value = Plan1.Cells(30, “b”) ‘Referencial foi adequado?
Plan2.Cells(X, “t”).Value = Plan1.Cells(32, “b”) ‘Observações
‘//===limpar
Plan1.Cells(6, “b”) = “”
Plan1.Cells(7, “b”) = “”
Plan1.Cells(6, “e”) = “”
Plan1.Cells(7, “e”) = “” ‘data da monitoria
Plan1.Cells(10, “b”) = “” ‘data da chamada’
Plan1.Cells(11, “b”) = “” ‘hora da chamada’
Plan1.Cells(12, “b”) = “” ‘duração da chamada
Plan1.Cells(13, “b”) = “” ‘cliente telefone
Plan1.Cells(16, “b”) = “” ‘atendeu em 6 minutos’
Plan1.Cells(17, “b”) = “” ‘solicitou telefone por callback
Plan1.Cells(18, “b”) = “” ‘informou protocolo
Plan1.Cells(21, “b”) = “” ‘Atendeu solicitação do cliente?
Plan1.Cells(22, “b”) = “” ‘houve acionamento via email
Plan1.Cells(23, “b”) = “” ‘houve necessidade de atendidmento diferenciado
Plan1.Cells(24, “b”) = “” ‘Cliente acionou Anatel/Procon?
Plan1.Cells(27, “b”) = “” ‘palpitou chamada ?
Plan1.Cells(28, “b”) = “” ‘teve cortesia
Plan1.Cells(29, “b”) = “” ‘Tom de voz adequado?
Plan1.Cells(30, “b”) = “” ‘Referencial foi adequado?
Plan1.Cells(32, “b”) = “” ‘Observações
MsgBox “Seus lançamentos foram realizados com sucesso!”, vbInformation, “Escola Saberexcel VBA Estudos®”
End Sub
Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos
Escola Saberexcel VBA Estudos® – Treinamentos com Macros, Fórmulas e Funções.
u – Seja um Assinante Saberexcel Acesse todo nosso Material didático: Procedimentos de Aquisição dos produtos Didáticos SaberExcel
Baixe o exemplo de planilha contendo os macros acima:
SBI Excel VBA cadastrar Monitorias IRD Fixa