Range("I4:N4").Select<br />Selection.Copy<br />    Application.GotoReference:="Fim"<br />Selection.End(xlUp).Select<br...
Sub Recepcao()<br />'Macro Recepção de Dados<br />DimVarCurso As String<br />DimVarData As Date<br />DimVarParticipante As...
Range("EntraCurso").Select<br />ActiveCell.FormulaR1C1 = VarCurso<br />    Range("EntraData").Select<br />ActiveCell.Formu...
Sub SalvaCadastro()<br />'<br />' SalvaCadastro Macro<br />' Salva Cadastro<br />'<br />' Atalho do teclado: Ctrl+s<br />'...
Private Sub BotOK_Click()<br />If OptionButton1.Value = TrueThen<br />SortCurso<br />ElseIf OptionButton2.Value = TrueThen...
Private Sub BtOK_Click()<br />VarCurso = CxCadastro.CampoCurso<br />VarData = CxCadastro.CampoData<br />VarParticipante = ...
    Transporte<br />CxCadastro.CampoCurso = ""<br />CxCadastro.CampoData = ""<br />CxCadastro.CampoParticipante = ""<br />...
Upcoming SlideShare
Loading in …5
×

Excel vba 2007

1,294 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,294
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
56
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Excel vba 2007

  1. 1.
  2. 2. Range("I4:N4").Select<br />Selection.Copy<br /> Application.GotoReference:="Fim"<br />Selection.End(xlUp).Select<br />Range(“A9”).Select<br />ActiveSheet.Paste<br /> Application.CutCopyMode = False<br /> Application.GotoReference:="R1C1"<br /> Range("I4:N4").Select<br />Selection.Copy<br /> Application.GotoReference:="Fim"<br />Selection.End(xlUp).Select<br />ActiveCell.Offset(1, 0).Range("A1").Select<br />ActiveSheet.Paste<br /> Application.CutCopyMode = False<br /> Application.GotoReference:="R1C1"<br />
  3. 3. Sub Recepcao()<br />'Macro Recepção de Dados<br />DimVarCurso As String<br />DimVarData As Date<br />DimVarParticipante As String<br />DimVarDepto As String<br />DimVarEmpresa As String<br />DimVarCusto As Single<br />VarCurso = Application.InputBox("Entre o Curso:", , , , , , 2) 'O Valor 2 no InputBox para dados Alfanumericos<br />VarData = Application.InputBox("Entre a Data:", , , , , , 1) 'O Valor 1 no InputBox para dados numericos<br />VarParticipante = Application.InputBox("Entre o Participante:", , , , , , 2)<br />VarDepto = Application.InputBox("Entre o Departamento:", , , , , , 2)<br />VarEmpresa = Application.InputBox("Entre a Empresa:", , , , , , 2)<br />VarCusto = Application.InputBox("Entre o Custo:", , , , , , 1)<br />
  4. 4. Range("EntraCurso").Select<br />ActiveCell.FormulaR1C1 = VarCurso<br /> Range("EntraData").Select<br />ActiveCell.FormulaR1C1 = VarData<br /> Range("EntraParticipante").Select<br />ActiveCell.FormulaR1C1 = VarParticipante<br /> Range("EntraDepto").Select<br />ActiveCell.FormulaR1C1 = VarDepto<br /> Range("EntraEmpresa").Select<br />ActiveCell.FormulaR1C1 = VarEmpresa<br /> Range("EntraCusto").Select<br />ActiveCell.FormulaR1C1 = VarCusto<br />End Sub<br />
  5. 5. Sub SalvaCadastro()<br />'<br />' SalvaCadastro Macro<br />' Salva Cadastro<br />'<br />' Atalho do teclado: Ctrl+s<br />'<br />VarSalva = MsgBox("Deseja Salvar?", 1 + 32, "Salvar Dados")<br />IfVarSalva = vbOKThen<br /> Application.StatusBar = "Salvando Arquivo - Aguarde!!!"<br />ActiveWorkbook.Save<br />MsgBox "Arquivo salvo com sucesso", 64, "Salvo"<br />EndIf<br /> Application.StatusBar = False<br />End Sub<br />
  6. 6.
  7. 7. Private Sub BotOK_Click()<br />If OptionButton1.Value = TrueThen<br />SortCurso<br />ElseIf OptionButton2.Value = TrueThen<br />SortData<br />ElseIf OptionButton3.Value = TrueThen<br />SortParticipante<br />Else<br />SortRelatorio<br />EndIf<br />End Sub<br />Private Sub BotCancelar_Click()<br /> End<br />End Sub<br />
  8. 8.
  9. 9.
  10. 10. Private Sub BtOK_Click()<br />VarCurso = CxCadastro.CampoCurso<br />VarData = CxCadastro.CampoData<br />VarParticipante = CxCadastro.CampoParticipante<br />VarDepto = CxCadastro.CampoDepto<br />VarEmpresa = CxCadastro.CampoEmpresa<br />VarCusto = CxCadastro.CampoCusto<br /> Range("EntraCurso").Select<br />ActiveCell.FormulaR1C1 = VarCurso<br /> Range("EntraData").Select<br />ActiveCell.FormulaR1C1 = VarData<br /> Range("EntraParticipante").Select<br />ActiveCell.FormulaR1C1 = VarParticipante<br /> Range("EntraDepto").Select<br />ActiveCell.FormulaR1C1 = VarDepto<br /> Range("EntraEmpresa").Select<br />ActiveCell.FormulaR1C1 = VarEmpresa<br /> Range("EntraCusto").Select<br />ActiveCell.FormulaR1C1 = VarCusto<br />
  11. 11. Transporte<br />CxCadastro.CampoCurso = ""<br />CxCadastro.CampoData = ""<br />CxCadastro.CampoParticipante = ""<br />CxCadastro.CampoDepto = ""<br />CxCadastro.CampoEmpresa = ""<br />CxCadastro.CampoCusto = ""<br />End Sub<br />Private Sub BtCancelar_Click()<br />End<br />End Sub<br />

×