際際滷

際際滷Share a Scribd company logo
Excel vba 2007
    Range("I4:N4").SelectSelection.Copy    Application.GotoReference:="Fim"Selection.End(xlUp).SelectRange(A9).SelectActiveSheet.Paste    Application.CutCopyMode = False    Application.GotoReference:="R1C1"    Range("I4:N4").SelectSelection.Copy    Application.GotoReference:="Fim"Selection.End(xlUp).SelectActiveCell.Offset(1, 0).Range("A1").SelectActiveSheet.Paste    Application.CutCopyMode = False    Application.GotoReference:="R1C1"
Sub Recepcao()'Macro Recep巽達o de DadosDimVarCurso As StringDimVarData As DateDimVarParticipante As StringDimVarDepto As StringDimVarEmpresa As StringDimVarCusto As SingleVarCurso = Application.InputBox("Entre o Curso:", , , , , , 2) 'O Valor 2 no InputBox para dados AlfanumericosVarData = Application.InputBox("Entre a Data:", , , , , , 1) 'O Valor 1 no InputBox para dados numericosVarParticipante = Application.InputBox("Entre o Participante:", , , , , , 2)VarDepto = Application.InputBox("Entre o Departamento:", , , , , , 2)VarEmpresa = Application.InputBox("Entre a Empresa:", , , , , , 2)VarCusto = Application.InputBox("Entre o Custo:", , , , , , 1)
Range("EntraCurso").SelectActiveCell.FormulaR1C1 = VarCurso    Range("EntraData").SelectActiveCell.FormulaR1C1 = VarData    Range("EntraParticipante").SelectActiveCell.FormulaR1C1 = VarParticipante    Range("EntraDepto").SelectActiveCell.FormulaR1C1 = VarDepto    Range("EntraEmpresa").SelectActiveCell.FormulaR1C1 = VarEmpresa    Range("EntraCusto").SelectActiveCell.FormulaR1C1 = VarCustoEnd Sub
Sub SalvaCadastro()'' SalvaCadastro Macro' Salva Cadastro'' Atalho do teclado: Ctrl+s'VarSalva = MsgBox("Deseja Salvar?", 1 + 32, "Salvar Dados")IfVarSalva = vbOKThen        Application.StatusBar = "Salvando Arquivo - Aguarde!!!"ActiveWorkbook.SaveMsgBox "Arquivo salvo com sucesso", 64, "Salvo"EndIf    Application.StatusBar = FalseEnd Sub
Excel vba 2007
Private Sub BotOK_Click()If OptionButton1.Value = TrueThenSortCursoElseIf OptionButton2.Value = TrueThenSortDataElseIf OptionButton3.Value = TrueThenSortParticipanteElseSortRelatorioEndIfEnd SubPrivate Sub BotCancelar_Click()    EndEnd Sub
Excel vba 2007
Excel vba 2007
Private Sub BtOK_Click()VarCurso = CxCadastro.CampoCursoVarData = CxCadastro.CampoDataVarParticipante = CxCadastro.CampoParticipanteVarDepto = CxCadastro.CampoDeptoVarEmpresa = CxCadastro.CampoEmpresaVarCusto = CxCadastro.CampoCusto    Range("EntraCurso").SelectActiveCell.FormulaR1C1 = VarCurso   Range("EntraData").SelectActiveCell.FormulaR1C1 = VarData    Range("EntraParticipante").SelectActiveCell.FormulaR1C1 = VarParticipante    Range("EntraDepto").SelectActiveCell.FormulaR1C1 = VarDepto    Range("EntraEmpresa").SelectActiveCell.FormulaR1C1 = VarEmpresa    Range("EntraCusto").SelectActiveCell.FormulaR1C1 = VarCusto
    TransporteCxCadastro.CampoCurso = ""CxCadastro.CampoData = ""CxCadastro.CampoParticipante = ""CxCadastro.CampoDepto = ""CxCadastro.CampoEmpresa = ""CxCadastro.CampoCusto = ""End SubPrivate Sub BtCancelar_Click()EndEnd Sub

More Related Content

Excel vba 2007

  • 2. Range("I4:N4").SelectSelection.Copy Application.GotoReference:="Fim"Selection.End(xlUp).SelectRange(A9).SelectActiveSheet.Paste Application.CutCopyMode = False Application.GotoReference:="R1C1" Range("I4:N4").SelectSelection.Copy Application.GotoReference:="Fim"Selection.End(xlUp).SelectActiveCell.Offset(1, 0).Range("A1").SelectActiveSheet.Paste Application.CutCopyMode = False Application.GotoReference:="R1C1"
  • 3. Sub Recepcao()'Macro Recep巽達o de DadosDimVarCurso As StringDimVarData As DateDimVarParticipante As StringDimVarDepto As StringDimVarEmpresa As StringDimVarCusto As SingleVarCurso = Application.InputBox("Entre o Curso:", , , , , , 2) 'O Valor 2 no InputBox para dados AlfanumericosVarData = Application.InputBox("Entre a Data:", , , , , , 1) 'O Valor 1 no InputBox para dados numericosVarParticipante = Application.InputBox("Entre o Participante:", , , , , , 2)VarDepto = Application.InputBox("Entre o Departamento:", , , , , , 2)VarEmpresa = Application.InputBox("Entre a Empresa:", , , , , , 2)VarCusto = Application.InputBox("Entre o Custo:", , , , , , 1)
  • 4. Range("EntraCurso").SelectActiveCell.FormulaR1C1 = VarCurso Range("EntraData").SelectActiveCell.FormulaR1C1 = VarData Range("EntraParticipante").SelectActiveCell.FormulaR1C1 = VarParticipante Range("EntraDepto").SelectActiveCell.FormulaR1C1 = VarDepto Range("EntraEmpresa").SelectActiveCell.FormulaR1C1 = VarEmpresa Range("EntraCusto").SelectActiveCell.FormulaR1C1 = VarCustoEnd Sub
  • 5. Sub SalvaCadastro()'' SalvaCadastro Macro' Salva Cadastro'' Atalho do teclado: Ctrl+s'VarSalva = MsgBox("Deseja Salvar?", 1 + 32, "Salvar Dados")IfVarSalva = vbOKThen Application.StatusBar = "Salvando Arquivo - Aguarde!!!"ActiveWorkbook.SaveMsgBox "Arquivo salvo com sucesso", 64, "Salvo"EndIf Application.StatusBar = FalseEnd Sub
  • 7. Private Sub BotOK_Click()If OptionButton1.Value = TrueThenSortCursoElseIf OptionButton2.Value = TrueThenSortDataElseIf OptionButton3.Value = TrueThenSortParticipanteElseSortRelatorioEndIfEnd SubPrivate Sub BotCancelar_Click() EndEnd Sub
  • 10. Private Sub BtOK_Click()VarCurso = CxCadastro.CampoCursoVarData = CxCadastro.CampoDataVarParticipante = CxCadastro.CampoParticipanteVarDepto = CxCadastro.CampoDeptoVarEmpresa = CxCadastro.CampoEmpresaVarCusto = CxCadastro.CampoCusto Range("EntraCurso").SelectActiveCell.FormulaR1C1 = VarCurso Range("EntraData").SelectActiveCell.FormulaR1C1 = VarData Range("EntraParticipante").SelectActiveCell.FormulaR1C1 = VarParticipante Range("EntraDepto").SelectActiveCell.FormulaR1C1 = VarDepto Range("EntraEmpresa").SelectActiveCell.FormulaR1C1 = VarEmpresa Range("EntraCusto").SelectActiveCell.FormulaR1C1 = VarCusto
  • 11. TransporteCxCadastro.CampoCurso = ""CxCadastro.CampoData = ""CxCadastro.CampoParticipante = ""CxCadastro.CampoDepto = ""CxCadastro.CampoEmpresa = ""CxCadastro.CampoCusto = ""End SubPrivate Sub BtCancelar_Click()EndEnd Sub