Ir para conteúdo
Fórum Script Brasil
  • 0

Erro em tempo de execução '13'


Baku

Pergunta

Boa noite pessoal, como vão?

Sou novo no forum e preciso muito da ajuda de vocês. Estou trabalhando com uma planilha que não apresentava problemas até pouco tempo atrás, mas, após formatação do PC em que trabalho, ela começou à apresentar este ERRO.

Sou muito leigo em VBA, então, realmente preciso de ajuda tipo "passo-a-passo". Quando clico em "depurar" e abro o VBA, este seleciona de amarelo a parte em que expus em negrito e sublinhado:

Desde já agradeço.

Private Sub Botão_OK_Click()

'If Sheets("Simulação").Range("E8") = "10605-4" Then

' If Me.Rendimento > 2500 Then

' MsgBox "Digite um valor de Benefício <= R$2.500,00 !", vbCritical

' Me.Rendimento.SetFocus

' Exit Sub

' End If

'Else

' If Me.Rendimento > 2500 Then

' MsgBox "Digite um valor de Rendimento Líquido <= R$2.500,00 !", vbCritical

' Me.Rendimento.SetFocus

' Exit Sub

' End If

'End If

' If Sheets("Simulação").Range("a2") = "1" Then

' Me.Remuneração = 0#

' Me.Remuneração.SetFocus

' Exit Sub

' Else

' Me.Remuneração = 0

' If Me.Remuneração > 0 Then

' Beep

' MsgBox "A Remuneração do CCA deve ser 0 ", vbCritical

' 'Me.Remuneração.SetFocus

' Me.Remuneração = 0

' Exit Sub

' End If

'End If

If Me.Valor = Empty Then

Beep

MsgBox "Digite um valor válido!", vbCritical

Me.Valor.SetFocus

Exit Sub

End If

If Me.DataConc = Empty Or Not IsDate(Me.DataConc) Then

Beep

MsgBox "Digite uma data válida!", vbCritical

Me.DataConc.SetFocus

Exit Sub

End If

If Me.Prazo = Empty Or Val(Me.Prazo) > Sheets("Simulação").Range("Y9") Then

Beep

MsgBox "Digite um prazo <= " & Sheets("Simulação").Range("Y9"), vbCritical

Me.Prazo.SetFocus

Exit Sub

End If

Dim int_Aux As Range

Dim Ln, Num As Long

Set int_Aux = Sheets("Convenente").Columns(1).Find("*", searchDirection:=xlPrevious)

Ln = int_Aux.Row

Volta:

Sheets("Cálculo").Range("C13") = CDate(DataConc.Value)

Sheets("Cálculo").Range("C5") = CSng(Prazo.Value)

' Sheets("Cálculo").Range("L4") = CSng(Remuneração.Value)

Sheets("Cálculo").Range("c3") = CSng(SaldoDevedor.Value)

If Prazo.Value < 7 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],6,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],6,FALSE)/100"

ElseIf Prazo.Value < 13 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],7,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],7,FALSE)/100"

ElseIf Prazo.Value < 25 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],8,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],8,FALSE)/100"

ElseIf Prazo.Value < 37 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],9,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],9,FALSE)/100"

ElseIf Prazo.Value < 49 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],10,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],10,FALSE)/100"

ElseIf Prazo.Value < 61 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],11,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],11,FALSE)/100"

ElseIf Prazo.Value < 73 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],12,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],12,FALSE)/100"

ElseIf Prazo.Value < 97 Then

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],12,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],13,FALSE)/100"

Else

' Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[9],13,FALSE)/100"

Sheets("Cálculo").Range("C6").FormulaR1C1 = "=VLOOKUP(Simulação!R[3]C[4],Convenente!R[-3]C[-2]:R[" & Ln - 6 & "]C[11],14,FALSE)/100"

End If

' If OptionButton1.Value = False Then

' Sheets("Cálculo").Range("C4") = CDbl(Valor.Value)

' End If

If OptionButton2.Value = True Then

' Sheets("Cálculo").Range("C11").GoalSeek Goal:=CDbl(Valor.Value), ChangingCell:=Sheets("Cálculo").Range("C11")

Sheets("Cálculo").Range("C11") = CDbl(Valor.Value)

End If

If OptionButton3.Value = True Then

Sheets("Cálculo").Range("C146").GoalSeek Goal:=CDbl(Valor.Value) * -1, ChangingCell:=Sheets("Cálculo").Range("C11")

End If

If Sheets("Simulação").Range("E8") = "10605-4" Then

If Sheets("Cálculo").Range("C21") * -1 >= Me.Rendimento * 0.3 Then

MsgBox "Prestação maior que o permitido! Será apresentado cálculo do valor máximo", vbCritical

Sheets("Cálculo").Range("C21").GoalSeek Goal:=Me.Rendimento * -0.3, ChangingCell:=Sheets("Cálculo").Range("C4")

End If

Else

If Sheets("Cálculo").Range("C21") * -1 >= Me.Rendimento * 0.3 Then

MsgBox "Prestação maior que o permitido! Será apresentado cálculo do valor máximo", vbCritical

Sheets("Cálculo").Range("C21").GoalSeek Goal:=Me.Rendimento * -0.3, ChangingCell:=Sheets("Cálculo").Range("C4")

End If

End If

' If OptionButton1.Value <> True Then

' Me.Valor = Round(Plan2.Cells(4, 3), 2)

' OptionButton1.Value = True

' GoTo Volta

' End If

Escolha.Hide

End Sub

Private Sub DataConc_Change()

End Sub

Private Sub Label10_Click()

End Sub

Private Sub TextBox2_Change()

End Sub

Private Sub OptionButton4_Click()

End Sub

Private Sub Label12_Click()

End Sub

Private Sub Label13_Click()

End Sub

Private Sub Label9_Click()

End Sub

Private Sub OptionButton1_Click()

End Sub

Private Sub Label2_Click()

End Sub

Private Sub OptionButton2_Click()

End Sub

Private Sub Prazo_Change()

End Sub

Private Sub Remuneração_Change()

End Sub

Private Sub TextBox1_Change()

End Sub

Private Sub Rendimento_Change()

End Sub

Private Sub SaldoDevedor_Change()

End Sub

Private Sub UserForm_Initialize()

If Sheets("Simulação").Range("E8") = "10605-4" Then

LabelRendimento.Caption = "Renda do Cliente"

' LabelRemuneração.Caption = 0

Else

LabelRendimento.Caption = "Renda do Cliente"

' LabelRemuneração.Caption = 2

End If

End Sub

Private Sub Valor_Change()

End Sub

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...