Function seems not working.

Function seems not working.

Is there an incompatible VBA Macro here to the ones zoho can read? Thanks

Sub APSMRUN()

    STOCHSW = Application.Range("WPSW")   'Value of stochastic switch
    If STOCHSW = 1 THEN Select JUMP1
    Range("NOW").Select
    Selection.Copy
    Range("START").Select
    ActiveSheet.Paste

JUMP1:
    Call ADELEFIN
    Calculate
    Range("WPST").Select
    Selection.Copy
    Range("WPST1").Select
    ActiveSheet.Paste

Dim NCYCLES As Integer
Dim TMAX As Integer
Dim NCROPS As Integer
Dim NLIVST As Integer
Dim GMA As Integer


    NCYCLES = Application.Range("NCYC")    '20-number of cycles/periods in the simulation
    TMAX = Application.Range("NITR")       '50-maximum number of iterations per cycle
    NCROPS = Application.Range("NC")       '9- number of crops market modeled
    NLIVST = Application.Range("NL")       '6- number of livestock markets modeled
    ZLIMIT = Application.Range("ZTL")
    NCOMM = NCROPS + NLIVST
    GMA = 0
    
    For CYCINDX = 1 To NCYCLES     'This is really the period or year
    
        Range("NPERIOD").Select
        ActiveCell = CYCINDX
        
 
    For ITER = 1 To TMAX
        If ITER > 1 Then Select AAA:

    Range("PVARDP1").Select
    ActiveCell.Offset(1, 0).Range("A1:H49").Formula = 0
        
AAA:

        Range("DPG").Select
        ActiveCell.Offset(7, 2).Range("A1").Select
        Range("DPRICES1").Select
        ActiveCell.Offset(ITER, 0).Range("A1").Select
            Let NZERO = 0
            For COMMINDX = 1 To NCOMM
                ActiveCell.Offset(0, 1).Range("A1").Select
                If Abs(ActiveCell) <= ZLIMIT Then NZERO = NZERO + 1
            Next
        If NZERO = NCOMM Then Select RECITERNO
    Next
        MsgBox "No convergence after " & TMAX & " iterations"
        
RECITERNO:
    Range("NITER").Select
    ActiveCell = ITER
    Range("AREA1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("AREAFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("YIELD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("YLDFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste
    
    Range("PRICE1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("PRICEFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("DURB1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("DURBFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("DRUR1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("DRURFIN").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("TFOOD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("TFOODFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("TOTD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("TOTDFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("NIMP1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:I1").Copy
    Range("NIMPFIN1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LCYLD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVCYLD1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste
    
    Range("LPROD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVPROD1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste
    
    Range("LPRICE1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVPRICE1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LVPCURB1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVPCURB1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LDRUR1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVPCRUR1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LFOOD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVTFOOD1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LTOTD1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVTDEM1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

    Range("LNIMP1").Select
    ActiveCell.Offset(ITER, 0).Range("A1:F1").Copy
    Range("LVNIMP1").Select
    ActiveCell.Offset(CYCINDX - 1, 0).Range("A1").Select
    ActiveSheet.Paste

Next
    STOCHSW = Application.Range("WPSW")   'Value of stochastic switch
    If STOCHSW = 1 Then Select JUMP2
    Range("NOW").Select
    Selection.Copy
    Range("END").Select
    ActiveSheet.Paste
    SIMELAPSED = Application.Range("ELAPSED")
    MsgBox "Simulation Run Completed, " & SIMELAPSED & " ELAPSED "
    Range("DATERUN").Select
    Selection.Copy
    Range("RUNDATE").Select
    ActiveSheet.Paste

JUMP2:
    Range("OPTIONS").Select
End Sub

Sub ADELEFIN()

    Range("AREAFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("YLDFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("PRICEFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("DURBFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("DRURFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("TFOODFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("TOTDFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("NIMPFIN1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVCYLD1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVPROD1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVPCURB1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVPCRUR1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVTFOOD1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVTDEM1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents

    Range("LVNIMP1").Select
    ActiveCell.Range("A1:J20").Select
    Selection.ClearContents
    
    Range("A1").Select
    End Sub

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • Slicers are now available in Zoho Sheet—filter your data interactively

                                                At Zoho Sheet, we diligently track user requests and feedback. In line with this, based on extensive user requests, we've integrated Slicers to pivot tables and are delighted to announce its release. Slicers are interactive visual filters that have add,
                                              • Check out the new Checkbox in Zoho Sheet

                                                Checkbox, the simple GUI widget that lets you choose between two mutually exclusive options i.e Yes or No, is now in Zoho Sheet. Having made it across the web, Checkbox is familiar but is still elusive to most spreadsheet software. Special developer ribbons, macros and all other complexities to add a checkbox to a spreadsheet? Not in Zoho Sheet. How to add Checkbox to Zoho Sheet? Adding a Checkbox in Zoho Sheet is simple. Select a cell/range and choose "Checkbox" in "Input Controls" under the Format
                                              • Format and analyze spreadsheet data with Zoho Sheet's Table

                                                While a spreadsheet helps you compile data for easy analysis, formatting helps make your data more comprehensible. We are happy to announce the release of Table, a crucial tool for improving data formatting in Zoho Sheet. More than a formatting tool,
                                              • Introducing Data Bars: Graphically represent changes in data within the cells

                                                Conditional formatting has helped millions of spreadsheet users analyze and highlight their data more efficiently. In addition to the classic rules, color scales, and icon sets available in Zoho Sheet, you can now apply Data Bars, a convenient method
                                              • Zia in Zoho Sheet now makes suggestions on conditional formats, picklists, and checkboxes

                                                Zia, Zoho's popular AI assistant, has been helping users succeed across Zoho applications since inception. In Zoho Sheet, Zia helps users efficiently build reports and analyze data with recommendations about data cleaning, charts, and pivot table. Also,


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now