Estou fazendo mesmo curso estou com alguns problemas!
me ajudem a terminar
no modulo1
Public Linha As Integer
Public Agenda As Worksheet
Public TotalReg As Integer
Private Sub cmdAnterior_Click()
Linha = Linha - 1
If Linha < 3 Then
    Linha = 2
    cmdAnterior.Enabled = False
End If
If Linha < TotalReg Then
    cmdProximo.Enabled = True
End If
MostrarReg
End Sub
Private Sub cmdExcluir_Click()
Dim Resposta
Resposta = MsgBox("Deseja excluir este registro?", vbYesNo + vbCritical, "Excluir Registro")
If Resposta = vbNo Then
    Exit Sub
End If
With Agenda
    .Rows(Linha).Delete
End With
TotalReg = Agenda.UsedRange.Rows.Count
Linha = 2
If TotalReg > 1 Then
    MostrarReg
Else
    LimparCampos
End If
End Sub
Private Sub cmdFechar_Click()
Unload frmAgenda
End Sub
Private Sub cmdLimpar_Click()
    LimpaCampos
End Sub
Sub LimpaCampos()
    lblCodigo.Caption = Agenda.Range("Registro").Value + 1
    txtNome.Value = ""
    txtEndereco.Value = ""
    txtPai.Value = ""
    txtMae.Value = ""
    txtTelefone.Value = ""
    txtNascimento.Value = ""
    txtBatismo.Value = ""
    txtNaturalidade.Value = ""
    txtEmail.Value = ""
End Sub
Private Sub cmdNovo_Click()
    LimpaCampos
    TotalReg = Agenda.UsedRange.Rows.Count
    Linha = TotalReg + 1
End Sub
Private Sub cmdProximo_Click()
If Linha > 1 Then
    cmdAnterior.Enabled = True
End If
Linha = Linha + 1
If Linha >= TotalReg Then
    Linha = TotalReg
    cmdProximo.Enabled = False
End If
MostrarReg
End Sub
Private Sub cmdSalvar_Click()
Dim Codigo
If txtNome.Value = "" Then
    MsgBox "Favor digitar o nome", vbOKOnly + vbCritical, "Salvar Registro"
    txtNome.SetFocus
    Exit Sub
End If
Codigo = Agenda.Range("Registro").Value + 1
Agenda.Range("Registro").Value = Codigo
SalvarReg
TotalReg = Agenda.UsedRange.Rows.Count
End Sub
Sub SalvarReg()
With Agenda
    .Cells(Linha, 1).Value = lblCodigo.Caption
    .Cells(Linha, 2).Value = txtNome.Value
    .Cells(Linha, 3).Value = txtEndereco.Value
    .Cells(Linha, 4).Value = txtPai.Value
    .Cells(Linha, 5).Value = txtMae.Value
    .Cells(Linha, 6).Value = txtTelefone.Value
    .Cells(Linha, 7).Value = txtNascimento.Value
    .Cells(Linha, 8).Value = txtBatismo.Value
    .Cells(Linha, 9).Value = txtNaturalidade.Value
    .Cells(Linha, 10).Value = txtEmail.Value
End With
End Sub
Sub MostrarReg()
With Agenda
    lblCodigo.Caption = .Cells(Linha, 1).Value
    txtNome.Value = .Cells(Linha, 2).Value
    txtEndereco.Value = .Cells(Linha, 3).Value
    txtPai.Value = .Cells(Linha, 4).Value
    txtMae.Value = .Cells(Linha, 5).Value
    txtTelefone.Value = .Cells(Linha, 6).Value
    txtNascimento.Value = .Cells(Linha, 7).Value
    txtBatismo.Value = .Cells(Linha, 8).Value
    txtNaturalidade.Value = .Cells(Linha, 9).Value
    txtEmail.Value = .Cells(Linha, 10).Value
End With
End Sub
                                                                                                	                                                
	                                         
                    
                    	
                            Postado : 30/01/2012 12:37 pm