Unknown error

Unknown error

Sub STOCHRUN()
'
' STOCHRUN Macro
' Macro recorded 5/4/2001 by Tirso B. Paris
' Revisions 6/3/2005
'
' Keyboard Shortcut: Ctrl+s
'
' Record Starting Time
    'Application.Goto Reference:="NOW"
    Range("NOW").Select
    Selection.Copy
    'Application.Goto Reference:="START"
    Range("START").Select
    'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    '    :=False, Transpose:=False
    ActiveSheet.Paste
    Sheets("Summary").Select
    Columns("H:IV").Select
    Selection.EntireColumn.Delete
    Range("A1").Select
 '   ActiveWorkbook.Save
    'Application.Goto Reference:="WPSW"
    Range("WPSW").Select
    ActiveCell.value = 1
'
    Dim NSR As Integer
    Dim N1 As Integer
    Dim N2 As Integer

    NSR = 3
    N1 = NSR + 1
    N2 = NSR + 2
    
'
' INSERT THESE TO AVE AND STDEV RESPECTIVELY
    For I = 1 To NSR
    'Application.Run "APSMRUN"
    Call APSMRUN
    Call CopySimResults
    'Application.Run "CopySimResults"
    Calculate
  *   Next
    
    Range("I2").Select
    Selection.End(xlToRight).Select
    ActiveCell.Offset(0, 2).Range("A1").Select
    ActiveCell.FormulaR1C1 = "Means"
    ActiveCell.Offset(0, 1).Range("A1").Select
    ActiveCell.FormulaR1C1 = "StDev"
    ActiveCell.Offset(3, -1).Range("A1").Select
' Change to N1
    ActiveCell.FormulaR1C1 = "=AVERAGE(RC[-4]:RC[-2])"
    ActiveCell.Offset(0, 1).Range("A1").Select
'
' Change to N2
    ActiveCell.FormulaR1C1 = "=STDEV(RC[-5]:RC[-3])"
    ActiveCell.Offset(0, -1).Range("A1:B1").Select
    Selection.NumberFormat = "0.0"
    Selection.Copy
    ActiveCell.Offset(1, 0).Range("A1:A1000").Select
    ActiveSheet.Paste
    'Application.Goto Reference:="WPSW"
    Range("WPSW").Select
    ActiveCell.value = 0

'   Record End Time of Run
    'Application.Goto Reference:="NOW"
    Range("NOW").Select
    Selection.Copy
    'Application.Goto Reference:="END"
    Range("END").Select
    'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    '    :=False, Transpose:=False
    ActiveSheet.Paste
    SIMELAPSED = Application.Range("ELAPSED")
    MsgBox "Stochastic Simulation Runs Completed, " & SIMELAPSED & " ELAPSED "
    'Application.Goto Reference:="DATERUN"
    Range("DATERUN").Select
    Selection.Copy
    Range("RUNDATE").Select
    'Application.Goto Reference:="RUNDATE"
    'Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    '    xlNone, SkipBlanks:=False, Transpose:=False
    ActiveSheet.Paste
    Sheets("Summary").Select
End Sub
Sub ClearSummary()
'This macro clears the summary sheet for recording purposes'

    Sheets("Summary").Select
    Columns("H:IV").Select
    Selection.EntireColumn.Delete
    Sheets("Options").Select
End Sub

I received an unknown error at line number 43. (or where "*" can be found). Thank you for the help.

      • 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,