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

        All-in-one knowledge management and training platform for your employees and customers.






                              Zoho Developer Community




                                                    • Desk Community Learning Series


                                                    • Digest


                                                    • Functions


                                                    • Meetups


                                                    • Kbase


                                                    • Resources


                                                    • Glossary


                                                    • Desk Marketplace


                                                    • MVP Corner


                                                    • Word of the Day


                                                    • Ask the Experts



                                                              • Sticky Posts

                                                              • What's new in Zoho Sheet: Simplify data entry and collaboration

                                                                Hello, Zoho Sheet community! Last year, our team was focused on research and development so we could deliver updates that enhance your spreadsheet experience. This year, we’re excited to deliver those enhancements—but we'll be rolling them out incrementally
                                                              • New Features: Repeat Last Action, Insert Cut/Copied Rows/Columns and Hyperlink

                                                                You might have noticed the constant updates to Zoho Sheet of late. Here are 3 more features that have been added to Zoho Sheet recently: F4 - Repeat Last Action Insert Cut/Copied Rows and Columns Insert Hyperlink Here is a screen cast demonstrating each of these features. Read further below to learn more about these new features. F4 - Repeat Last Action: You can now repeat the last action you made on your spreadsheet by using the keyboard shortcut, F4. It is quite handy and helps you get your work
                                                              • Introducing Forms in Zoho Sheet

                                                                We hereby bring you the power of ​forms in Zoho Sheet. ​Now, build and create your own customized forms using Zoho Sheet. Be it compiling a questionnaire or rolling out a survey, Zoho Sheet can do it all for you. Forms is an excellent feature that helps you collect information in the simplest of ways and having it in Zoho Sheet takes it a notch higher. Build Simple yet Powerful forms Building forms using Zoho Sheet is fairly simple. The exclusive 'Form' tab lets you create one quickly. Whether you
                                                              • 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,
                                                              • 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


                                                              Manage your brands on social media



                                                                    Zoho TeamInbox Resources



                                                                        Zoho CRM Plus Resources

                                                                          Zoho Books Resources


                                                                            Zoho Subscriptions Resources

                                                                              Zoho Projects Resources


                                                                                Zoho Sprints Resources


                                                                                  Qntrl Resources


                                                                                    Zoho Creator 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


                                                                                              Zoho Show Resources

                                                                                                Zoho Writer

                                                                                                Get Started. Write Away!

                                                                                                Writer is a powerful online word processor, designed for collaborative work.

                                                                                                  Zoho CRM コンテンツ




                                                                                                    Nederlandse Hulpbronnen


                                                                                                        ご検討中の方