اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

السلام عليكم 

ارجو منكم شرح للكود

 

 

 

Sub stepDown()
Const MyPassword As String = "000000000"
Dim ChangeProtection As Boolean
    With Sheets("SHL Mortgage Calculator")
        If .ProtectContents = True Then
        .Unprotect (MyPassword)
        ChangeProtection = True
        End If

            Call StepDownMaxRate
            Call StepDownMaxDSR
            If ThisWorkbook.Worksheets("Step Down Feature").Range("c12").Value < 1 Then
                MsgBox ("No Pension Period")
                ElseIf ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n2").Value = "" Then
                    MsgBox ("No Projected Income")
                    ElseIf ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n3").Value = "" Then
                        MsgBox ("No Annual Rate")
                        ElseIf ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n4").Value = "" Then
                            MsgBox ("No DSR")
                            Else
                            ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("b18").Value = 1
                            Call MC
                            ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("c21").Value
                            ThisWorkbook.Worksheets("Step Down Feature").Range("l21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("c21").Value
                            Do
                            ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value + 1000
                            Loop Until ThisWorkbook.Worksheets("Step Down Feature").Range("k18").Value > ThisWorkbook.Worksheets("Step Down Feature").Range("C6").Value
                            ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value - 1000
                            'Do
                            'ThisWorkbook.Worksheets("Step Down Feature").Range("l21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("l21").Value + 1000
                            'Loop Until ThisWorkbook.Worksheets("Step Down Feature").Range("l18").Value > (ThisWorkbook.Worksheets("Step Down Feature").Range("C6").Value * ThisWorkbook.Worksheets("Step Down Feature").Range("C7").Value)
                            'ThisWorkbook.Worksheets("Step Down Feature").Range("l21").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("l21").Value - 1000
                            ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n5").Value = ThisWorkbook.Worksheets("Step Down Feature").Range("k21").Value
                            ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n24").Value = ThisWorkbook.Worksheets("SHL Mortgage Calculator").Range("n10").Value
                            MsgBox ("Calculation Completed")
            End If
        If ChangeProtection = True Then
        .Protect (MyPassword)
        End If
    End With

End Sub
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information