13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.130 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 0 1 100001 0 1 0 1 1 0 1 0 00 0 1 1 1 0 1 100001 0 1 1 100001 13:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.1313:05 ET Dow -154.48 at 10309.92, Nasdaq -37.61 at 2138.44, S&P -19.13

.

.

Saturday, July 30, 2011

Visual Basic for Applications (VBA) Source Code From a Options Model I Programmed - 4

Sub print_grid_percent_one_page()
'
' print_grid_percent_one_page Macro
'

'
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .PrintTitleRows = ""
        .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
        .LeftHeader = "Returns Broken Down by Allocation"
        .CenterHeader = ""
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.2)
        .RightMargin = Application.InchesToPoints(0.2)
        .TopMargin = Application.InchesToPoints(0.25)
        .BottomMargin = Application.InchesToPoints(0.25)
        .HeaderMargin = Application.InchesToPoints(0.3)
        .FooterMargin = Application.InchesToPoints(0.3)
        .PrintHeadings = True
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .PrintQuality = 600
        .CenterHorizontally = False
        .CenterVertically = False
        .Orientation = xlLandscape
        .Draft = False
        .PaperSize = xlPaperLetter
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = False
        .PrintErrors = xlPrintErrorsDisplayed
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .ScaleWithDocHeaderFooter = True
        .AlignMarginsHeaderFooter = True
        .EvenPage.LeftHeader.Text = ""
        .EvenPage.CenterHeader.Text = ""
        .EvenPage.RightHeader.Text = ""
        .EvenPage.LeftFooter.Text = ""
        .EvenPage.CenterFooter.Text = ""
        .EvenPage.RightFooter.Text = ""
        .FirstPage.LeftHeader.Text = ""
        .FirstPage.CenterHeader.Text = ""
        .FirstPage.RightHeader.Text = ""
        .FirstPage.LeftFooter.Text = ""
        .FirstPage.CenterFooter.Text = ""
        .FirstPage.RightFooter.Text = ""
    End With
    Application.PrintCommunication = True
    ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
End Sub
Sub Macro3()
'
' Macro3 Macro
'



    Application.ScreenUpdating = True

    Application.ScreenUpdating = False
    Range("DA1229:EK1236").Select
    Range("EK1236").Activate
    ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
    Range("b1:c2").Select
      Application.ScreenUpdating = True
End Sub
Sub Macro4()
'
' Macro4 Macro
'

'
    Range("DB1230:EK1236").Select
    Range("EK1236").Activate
    ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,1,,,TRUE,,FALSE)"
    Range("b1:c2").Select
End Sub
Sub GoHome()
'
' GoHome Macro
'

'
    Range("B1").Select
End Sub

Sub CreateChart()
    Dim MyChart As Chart
    Set MyChart = ActiveSheet.Shapes.AddChart(xlLineMarkers).Chart
End Sub
Sub ChartSlideShow()
    Dim Cht As ChartObject
    Dim UserSheet As Worksheet
    Set UserSheet = ActiveSheet
    Application.DisplayFullScreen = True
    Application.DisplayAlerts = False

    For Each Cht In UserSheet.ChartObjects
        Application.ScreenUpdating = False
        ' Delete old chart sheet if it exists
        On Error Resume Next
        Charts("ChartTemp").Delete
        On Error GoTo 0
        ' Copy embedded chart and move it
        UserSheet.Activate
        Cht.Chart.ChartArea.Copy
        ActiveSheet.Paste
        ActiveChart.Location Where:=xlLocationAsNewSheet, _
           Name:="ChartTemp"
        ' Show the chart sheet and prompt for next one
        Application.ScreenUpdating = True
        If MsgBox("OK for next chart, Cancel to stop.", _
          vbQuestion + vbOKCancel) = vbCancel Then Exit For
     Next Cht
     ' Clean up
     On Error Resume Next
     Charts("ChartTemp").Delete
     On Error GoTo 0
     Application.DisplayFullScreen = False
     Application.DisplayAlerts = True
     UserSheet.Activate
End Sub


------------------------------
Sub ShowSetInitialConditionForm()



OptionsQuantityForm.put_rate_txt.Value = 5
OptionsQuantityForm.call_rate_txt.Value = 5
OptionsQuantityForm.bucket_rate_txt.Value = 5

OptionsQuantityForm.Show


End Sub



Sub Proc(sParam1 As String, iParam2 As Integer)
        MsgBox sParam1 & " is " & iParam2 & " Years Old"
End Sub

Sub VLookupTest()

Dim theDate As Long
Dim theRange As Range
Dim Value As Variant
Dim modif, startCell As Double
Dim dda, dt As Date
Dim i, lps, endRow As Integer
Dim stg As String
Dim lMun As Integer

theDate = #1/19/2007#

Set theRange = Worksheets("EEM_CALLS").Range("EEM_CALLS_Table")


theDate = Application.VLookup(theDate, theRange, 1, False)
ActiveCell.Offset(1, 0).Select
Value = ActiveCell.Value
stg = "#" & Value & "#"
ActiveCell.Offset(1, 0).Select

startCell = ActiveCell.Row

theRow = ActiveCell.Row
ActiveCell.Range("a1").Select

lps = 0
lMun = 0
Do While ActiveCell.Value = theDate
lMun = lMun + 1
ActiveCell.Offset(1, 0).Select
Loop

ActiveCell.Offset(-1, 0).Select
endRow = ActiveCell.Row
    
MsgBox dda & " " & vbCrLf & startCell & " " & vbCrLf & endRow & vbCrLf & Value & vbCrLf & lMun

End Sub


------------------------------
Sub Macro2()
'
' Macro2 Macro
'

'
   ActiveSheet.ShowAllData
End Sub


------------------------------
Sub Macro5()
'
' Macro5 Macro
'

'
    Range("M10").Select
    ActiveSheet.Paste
End Sub

------------------------------
Sub showw()
IndividualPeriodsForm.start_int_cmbo.AddItem "T1"
IndividualPeriodsForm.start_int_cmbo.AddItem "T2"
IndividualPeriodsForm.start_int_cmbo.AddItem "T3"
IndividualPeriodsForm.start_int_cmbo.AddItem "T4"
IndividualPeriodsForm.start_int_cmbo.AddItem "T5"
IndividualPeriodsForm.start_int_cmbo.AddItem "T6"
IndividualPeriodsForm.start_int_cmbo.AddItem "T7"
IndividualPeriodsForm.start_int_cmbo.AddItem "T8"
IndividualPeriodsForm.start_int_cmbo.AddItem "T9"
IndividualPeriodsForm.start_int_cmbo.AddItem "T10"
IndividualPeriodsForm.start_int_cmbo.AddItem "T11"
IndividualPeriodsForm.start_int_cmbo.AddItem "T12"
IndividualPeriodsForm.start_int_cmbo.AddItem "T13"
IndividualPeriodsForm.start_int_cmbo.AddItem "T14"
IndividualPeriodsForm.start_int_cmbo.AddItem "T15"
IndividualPeriodsForm.start_int_cmbo.AddItem "T16"
IndividualPeriodsForm.start_int_cmbo.AddItem "T17"
IndividualPeriodsForm.start_int_cmbo.AddItem "T18"
IndividualPeriodsForm.start_int_cmbo.AddItem "T19"
IndividualPeriodsForm.start_int_cmbo.AddItem "T20"
IndividualPeriodsForm.start_int_cmbo.AddItem "T21"
IndividualPeriodsForm.start_int_cmbo.AddItem "T22"
IndividualPeriodsForm.start_int_cmbo.AddItem "T23"
IndividualPeriodsForm.start_int_cmbo.AddItem "T24"
IndividualPeriodsForm.start_int_cmbo.AddItem "T25"
IndividualPeriodsForm.start_int_cmbo.AddItem "T26"
IndividualPeriodsForm.start_int_cmbo.AddItem "T27"
IndividualPeriodsForm.start_int_cmbo.AddItem "T28"
IndividualPeriodsForm.start_int_cmbo.AddItem "T29"
IndividualPeriodsForm.start_int_cmbo.AddItem "T30"
IndividualPeriodsForm.start_int_cmbo.AddItem "T31"
IndividualPeriodsForm.start_int_cmbo.AddItem "T32"
IndividualPeriodsForm.start_int_cmbo.AddItem "T33"
IndividualPeriodsForm.start_int_cmbo.AddItem "T34"
IndividualPeriodsForm.start_int_cmbo.AddItem "T35"

IndividualPeriodsForm.end_int_cmbo.AddItem "T2"
IndividualPeriodsForm.end_int_cmbo.AddItem "T3"
IndividualPeriodsForm.end_int_cmbo.AddItem "T4"
IndividualPeriodsForm.end_int_cmbo.AddItem "T5"
IndividualPeriodsForm.end_int_cmbo.AddItem "T6"
IndividualPeriodsForm.end_int_cmbo.AddItem "T7"
IndividualPeriodsForm.end_int_cmbo.AddItem "T8"
IndividualPeriodsForm.end_int_cmbo.AddItem "T9"
IndividualPeriodsForm.end_int_cmbo.AddItem "T10"
IndividualPeriodsForm.end_int_cmbo.AddItem "T11"
IndividualPeriodsForm.end_int_cmbo.AddItem "T12"
IndividualPeriodsForm.end_int_cmbo.AddItem "T13"
IndividualPeriodsForm.end_int_cmbo.AddItem "T14"
IndividualPeriodsForm.end_int_cmbo.AddItem "T15"
IndividualPeriodsForm.end_int_cmbo.AddItem "T16"
IndividualPeriodsForm.end_int_cmbo.AddItem "T17"
IndividualPeriodsForm.end_int_cmbo.AddItem "T18"
IndividualPeriodsForm.end_int_cmbo.AddItem "T19"
IndividualPeriodsForm.end_int_cmbo.AddItem "T20"
IndividualPeriodsForm.end_int_cmbo.AddItem "T21"
IndividualPeriodsForm.end_int_cmbo.AddItem "T22"
IndividualPeriodsForm.end_int_cmbo.AddItem "T23"
IndividualPeriodsForm.end_int_cmbo.AddItem "T24"
IndividualPeriodsForm.end_int_cmbo.AddItem "T25"
IndividualPeriodsForm.end_int_cmbo.AddItem "T26"
IndividualPeriodsForm.end_int_cmbo.AddItem "T27"
IndividualPeriodsForm.end_int_cmbo.AddItem "T28"
IndividualPeriodsForm.end_int_cmbo.AddItem "T29"
IndividualPeriodsForm.end_int_cmbo.AddItem "T30"
IndividualPeriodsForm.end_int_cmbo.AddItem "T31"
IndividualPeriodsForm.end_int_cmbo.AddItem "T32"
IndividualPeriodsForm.end_int_cmbo.AddItem "T33"
IndividualPeriodsForm.end_int_cmbo.AddItem "T34"
IndividualPeriodsForm.end_int_cmbo.AddItem "T35"
IndividualPeriodsForm.end_int_cmbo.AddItem "T36"

IndividualPeriodsForm.interval_1_dbc.Caption = Worksheets("Home").Range("weights_interval_1_dbc").Value
IndividualPeriodsForm.interval_1_eem.Caption = Worksheets("Home").Range("weights_interval_1_eem").Value
IndividualPeriodsForm.interval_1_efa.Caption = Worksheets("Home").Range("weights_interval_1_efa").Value
IndividualPeriodsForm.interval_1_iwm.Caption = Worksheets("Home").Range("weights_interval_1_iwm").Value
IndividualPeriodsForm.interval_1_iyr.Caption = Worksheets("Home").Range("weights_interval_1_iyr").Value
IndividualPeriodsForm.interval_1_mdy.Caption = Worksheets("Home").Range("weights_interval_1_mdy").Value
IndividualPeriodsForm.interval_1_spy.Caption = Worksheets("Home").Range("weights_interval_1_spy").Value
IndividualPeriodsForm.interval_2_dbc.Caption = Worksheets("Home").Range("weights_interval_2_dbc").Value
IndividualPeriodsForm.interval_2_eem.Caption = Worksheets("Home").Range("weights_interval_2_eem").Value
IndividualPeriodsForm.interval_2_efa.Caption = Worksheets("Home").Range("weights_interval_2_efa").Value
IndividualPeriodsForm.interval_2_iwm.Caption = Worksheets("Home").Range("weights_interval_2_iwm").Value
IndividualPeriodsForm.interval_2_iyr.Caption = Worksheets("Home").Range("weights_interval_2_iyr").Value
IndividualPeriodsForm.interval_2_mdy.Caption = Worksheets("Home").Range("weights_interval_2_mdy").Value
IndividualPeriodsForm.interval_2_spy.Caption = Worksheets("Home").Range("weights_interval_2_spy").Value
IndividualPeriodsForm.interval_3_dbc.Caption = Worksheets("Home").Range("weights_interval_3_dbc").Value
IndividualPeriodsForm.interval_3_eem.Caption = Worksheets("Home").Range("weights_interval_3_eem").Value
IndividualPeriodsForm.interval_3_efa.Caption = Worksheets("Home").Range("weights_interval_3_efa").Value
IndividualPeriodsForm.interval_3_iyr.Caption = Worksheets("Home").Range("weights_interval_3_iwm").Value
IndividualPeriodsForm.interval_3_iwm.Caption = Worksheets("Home").Range("weights_interval_3_iyr").Value
IndividualPeriodsForm.interval_3_mdy.Caption = Worksheets("Home").Range("weights_interval_3_mdy").Value
IndividualPeriodsForm.interval_3_spy.Caption = Worksheets("Home").Range("weights_interval_3_spy").Value
IndividualPeriodsForm.range_1.Caption = Worksheets("Home").Range("interval_1").Value
IndividualPeriodsForm.range_2.Caption = Worksheets("Home").Range("interval_2").Value
IndividualPeriodsForm.range_3.Caption = Worksheets("Home").Range("interval_3").Value



IndividualPeriodsForm.Show

End Sub

------------------------------
Sub find()
'
' find Macro
Cells.find(what:="39157.00", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
End Sub
Sub SearchColumn()
Dim SearchRange As Range
Dim dDate As Date
Dim i As Variant
Dim cell As Range
Dim firstFoundCell As Variant
dDate = "4/23/2007"
Set SearchRange = Range("H:H")
i = Application.Match(CLng(dDate), SearchRange, 0)
If Not IsError(i) Then
   Set cell = SearchRange(i)
   firstFoundCell = cell.Address
   cell.Select
   MsgBox ("The cell address is " & firstFoundCell & vbCrLf)
Else
    MsgBox "No match found"
End If

End Sub

------------------------------
Sub Macro7()
'
' Macro7 Macro
'
Dim Dog As Double
Dim cat As Range

    ActiveSheet.ListObjects("Table8").Range.AutoFilter Field:=2, Operator:= _
        xlFilterValues, Criteria2:=Array(1, "3/16/2007")
    ActiveSheet.ListObjects("Table8").Range.AutoFilter Field:=3, Operator:= _
        xlFilterValues, Criteria2:=Array(2, "2/20/2007")
    Application.WindowState = xlNormal
    Application.WindowState = xlMaximized
    Selection.SpecialCells(xlCellTypeVisible).Select
    Set cat = ActiveRange
    
End Sub

Sub eatsh()
Dim ethan As Variant
Dim castanon As Variant
Dim LastRow As Long
Dim count As Integer
Dim FinalRow As Integer, ThisRow As Integer
Dim CurrRow As Integer
Dim expDate, tradeDate As Long
Dim theRange As Range
expDate = #3/16/2007#
tradeDate = #2/20/2007#



With Worksheets(5)
LastRow = .Cells(.Rows.count, "A").End(xlUp).Row
End With

With Worksheets(5).Range("h13:h65000")
    ActiveCell.Value = tradeDate
        With Worksheets(5).Range("g13:g65000")
            ActiveCell.Value = expDate
        End With
End With





MsgBox LastRow


End Sub

Sub datefilt()
Dim expDate, tradeDate As Long
Dim theRange As Range
expDate = #3/16/2007#
tradeDate = #2/20/2007#
Set theRange = Worksheets("EEM_CALLS").Range("EEM_CALLS_Table")
With Worksheets(5).Column(7) = expDate

End With

End Sub

Sub Violator()



End Sub

------------------------------







Sub NewBook()

Dim myRange, newRange As Range
Dim i As Long, j As Long
Dim theVal As Variant
Dim NwBkName As Variant
Dim NewBook As Workbook
Set NewBook = Workbooks.Add

NewBook.SaveAs Filename:="C:\Users\crowbar\Documents\fund work\final\temp.xlsx"





NewBook.Activate


End Sub





------------------------------
Sub PutStrikeProximityUp_Click()

Dim Nt As Variant

Nt = Range("k4").Value
    
    Range("k4").Value = 0.0025 + Nt
  
       
End Sub
Sub PutStrikeProximityDown_Click()

Dim dt As Variant

dt = Range("k4").Value

    Range("k4").Value = -0.0025 + dt
       
    
End Sub

Sub RoundedRectangle7_Click()

Range("H8").Value = 10

End Sub


------------------------------
Sub ResetWts()

Application.ScreenUpdating = False
Range("e23").Value = "=W14*$Y$13"
Range("e24").Value = "=W15*$Y$13"
Range("e25").Value = "=W16*$Y$13"
Range("e26").Value = "=W17*$Y$13"
Range("e27").Value = "=W18*$Y$13"
Range("e28").Value = "=W19*$Y$13"
Range("e29").Value = "=X15*$Y$13"
Range("e36").Value = "=W14*X31"
Range("e37").Value = "=W15*$X$31"
Range("e38").Value = "=W16*$X$31"
Range("e39").Value = "=W17*$X$31"
Range("e40").Value = "=W18*$X$31"
Range("e41").Value = "=W19*$X$31"
Range("e42").Value = "=X31*X$15"
Range("e49").Value = "=$W$14*X44"
Range("e50").Value = "=$X$44*W15"
Range("e51").Value = "=$X$44*W16"
Range("e52").Value = "=$X$44*W17"
Range("e53").Value = "=$X$44*W18"
Range("e54").Value = "=$X$44*W19"
Range("e55").Value = "=$X$44*X15"
Range("e62").Value = "=1*$W$14*X57"
Range("e63").Value = "=1*$W$15*X57"
Range("e64").Value = "=$W$16*X57"
Range("e65").Value = "=$W$17*X57"
Range("e66").Value = "=$W$18*X57"
Range("e67").Value = "=$W$19*X57"
Range("e68").Value = "=$X$15*X57"
Range("e75").Value = "=1*$W$14*X70"
Range("e76").Value = "=1*$W$15*X70"
Range("e77").Value = "=$W$16*X70"
Range("e78").Value = "=$W$17*X70"
Range("e79").Value = "=$W$18*X70"
Range("e80").Value = "=$W$19*X70"
Range("e81").Value = "=$X$15*X70"
Range("e88").Value = "=1*$W$14*X83"
Range("e89").Value = "=1*$W$15*X83"
Range("e90").Value = "=$W$16*X83"
Range("e91").Value = "=$W$17*X83"
Range("e92").Value = "=$W$18*X83"
Range("e93").Value = "=$W$19*X83"
Range("e94").Value = "=$X$15*X83"
Range("e101").Value = "=1*$W$14*X96"
Range("e102").Value = "=1*$W$15*X96"
Range("e103").Value = "=$W$16*X96"
Range("e104").Value = "=$W$17*X96"
Range("e105").Value = "=$W$18*X96"
Range("e106").Value = "=$W$19*X96"
Range("e107").Value = "=$X$15*X96"
Range("e114").Value = "=1*$W$14*X109"
Range("e115").Value = "=1*$W$15*X109"
Range("e116").Value = "=$W$16*X109"
Range("e117").Value = "=$W$17*X109"
Range("e118").Value = "=$W$18*X109"
Range("e119").Value = "=$W$19*X109"
Range("e120").Value = "=$X$15*X109"
Range("e127").Value = "=1*$W$14*X122"
Range("e128").Value = "=1*$W$15*X122"
Range("e129").Value = "=$W$16*X122"
Range("e130").Value = "=$W$17*X122"
Range("e131").Value = "=$W$18*X122"
Range("e132").Value = "=$W$19*X122"
Range("e133").Value = "=$X$15*X122"
Range("e140").Value = "=1*$W$14*X135"
Range("e141").Value = "=1*$W$15*X135"
Range("e142").Value = "=$W$16*X135"
Range("e143").Value = "=$W$17*X135"
Range("e144").Value = "=$W$18*X135"
Range("e145").Value = "=$W$19*X135"
Range("e146").Value = "=$X$15*X135"
Range("e153").Value = "=1*$W$14*X148"
Range("e154").Value = "=1*$W$15*X148"
Range("e155").Value = "=$W$16*X148"
Range("e156").Value = "=$W$17*X148"
Range("e157").Value = "=$W$18*X148"
Range("e158").Value = "=$W$19*X148"
Range("e159").Value = "=$X$15*X148"
Range("e166").Value = "=1*$W$14*X161"
Range("e167").Value = "=1*$W$15*X161"
Range("e168").Value = "=$W$16*X161"
Range("e169").Value = "=$W$17*X161"
Range("e170").Value = "=$W$18*X161"
Range("e171").Value = "=$W$19*X161"
Range("e172").Value = "=$X$15*X161"
Range("e179").Value = "=1*$W$14*X174"
Range("e180").Value = "=1*$W$15*X174"
Range("e181").Value = "=$W$16*X174"
Range("e182").Value = "=$W$17*X174"
Range("e183").Value = "=$W$18*X174"
Range("e184").Value = "=$W$19*X174"
Range("e185").Value = "=$X$15*X174"
Range("e192").Value = "=1*$W$14*X187"
Range("e193").Value = "=1*$W$15*X187"
Range("e194").Value = "=$W$16*X187"
Range("e195").Value = "=$W$17*X187"
Range("e196").Value = "=$W$18*X187"
Range("e197").Value = "=$W$19*X187"
Range("e198").Value = "=$X$15*X187"
Range("e205").Value = "=1*$W$14*X200"
Range("e206").Value = "=1*$W$15*X200"
Range("e207").Value = "=$W$16*X200"
Range("e208").Value = "=$W$17*X200"
Range("e209").Value = "=$W$18*X200"
Range("e210").Value = "=$W$19*X200"
Range("e211").Value = "=$X$15*X200"
Range("e218").Value = "=1*$W$14*X213"
Range("e219").Value = "=1*$W$15*X213"
Range("e220").Value = "=$W$16*X213"
Range("e221").Value = "=$W$17*X213"
Range("e222").Value = "=$W$18*X213"
Range("e223").Value = "=$W$19*X213"
Range("e224").Value = "=$X$15*X213"
Range("e231").Value = "=1*$W$14*X226"
Range("e232").Value = "=1*$W$15*X226"
Range("e233").Value = "=$W$16*X226"
Range("e234").Value = "=$W$17*X226"
Range("e235").Value = "=$W$18*X226"
Range("e236").Value = "=$W$19*X226"
Range("e237").Value = "=$X$15*X226"
Range("e244").Value = "=1*$W$14*X239"
Range("e245").Value = "=1*$W$15*X239"
Range("e246").Value = "=$W$16*X239"
Range("e247").Value = "=$W$17*X239"
Range("e248").Value = "=$W$18*X239"
Range("e249").Value = "=$W$19*X239"
Range("e250").Value = "=$X$15*X239"
Range("e257").Value = "=1*$W$14*X252"
Range("e258").Value = "=1*$W$15*X252"
Range("e259").Value = "=$W$16*X252"
Range("e260").Value = "=$W$17*X252"
Range("e261").Value = "=$W$18*X252"
Range("e262").Value = "=$W$19*X252"
Range("e263").Value = "=$X$15*X252"
Range("e270").Value = "=1*$W$14*X265"
Range("e271").Value = "=1*$W$15*X265"
Range("e272").Value = "=$W$16*X265"
Range("e273").Value = "=$W$17*X265"
Range("e274").Value = "=$W$18*X265"
Range("e275").Value = "=$W$19*X265"
Range("e276").Value = "=$X$15*X265"
Range("e283").Value = "=1*$W$14*X278"
Range("e284").Value = "=1*$W$15*X278"
Range("e285").Value = "=$W$16*X278"
Range("e286").Value = "=$W$17*X278"
Range("e287").Value = "=$W$18*X278"
Range("e288").Value = "=$W$19*X278"
Range("e289").Value = "=$X$15*X278"
Range("e296").Value = "=1*$W$14*X291"
Range("e297").Value = "=1*$W$15*X291"
Range("e298").Value = "=$W$16*X291"
Range("e299").Value = "=$W$17*X291"
Range("e300").Value = "=$W$18*X291"
Range("e301").Value = "=$W$19*X291"
Range("e302").Value = "=$X$15*X291"
Range("e309").Value = "=1*$W$14*X304"
Range("e310").Value = "=1*$W$15*X304"
Range("e311").Value = "=$W$16*X304"
Range("e312").Value = "=$W$17*X304"
Range("e313").Value = "=$W$18*X304"
Range("e314").Value = "=$W$19*X304"
Range("e315").Value = "=$X$15*X304"
Range("e322").Value = "=1*$W$14*X317"
Range("e323").Value = "=1*$W$15*X317"
Range("e324").Value = "=$W$16*X317"
Range("e325").Value = "=$W$17*X317"
Range("e326").Value = "=$W$18*X317"
Range("e327").Value = "=$W$19*X317"
Range("e328").Value = "=$X$15*X317"
Range("e335").Value = "=1*$W$14*X330"
Range("e336").Value = "=1*$W$15*X330"
Range("e337").Value = "=$W$16*X330"
Range("e338").Value = "=$W$17*X330"
Range("e339").Value = "=$W$18*X330"
Range("e340").Value = "=$W$19*X330"
Range("e341").Value = "=$X$15*X330"
Range("e348").Value = "=1*$W$14*X343"
Range("e349").Value = "=1*$W$15*X343"
Range("e350").Value = "=$W$16*X343"
Range("e351").Value = "=$W$17*X343"
Range("e352").Value = "=$W$18*X343"
Range("e353").Value = "=$W$19*X343"
Range("e354").Value = "=$X$15*X343"
Range("e361").Value = "=1*$W$14*X356"
Range("e362").Value = "=1*$W$15*X356"
Range("e363").Value = "=$W$16*X356"
Range("e364").Value = "=$W$17*X356"
Range("e365").Value = "=$W$18*X356"
Range("e366").Value = "=$W$19*X356"
Range("e367").Value = "=$X$15*X356"
Range("e374").Value = "=1*$W$14*X369"
Range("e375").Value = "=1*$W$15*X369"
Range("e376").Value = "=$W$16*X369"
Range("e377").Value = "=$W$17*X369"
Range("e378").Value = "=$W$18*X369"
Range("e379").Value = "=$W$19*X369"
Range("e380").Value = "=$X$15*X369"
Range("e387").Value = "=1*$W$14*X382"
Range("e388").Value = "=1*$W$15*X382"
Range("e389").Value = "=$W$16*X382"
Range("e390").Value = "=$W$17*X382"
Range("e391").Value = "=$W$18*X382"
Range("e392").Value = "=$W$19*X382"
Range("e393").Value = "=$X$15*X382"
Range("e400").Value = "=1*$W$14*X395"
Range("e401").Value = "=1*$W$15*X395"
Range("e402").Value = "=$W$16*X395"
Range("e403").Value = "=$W$17*X395"
Range("e404").Value = "=$W$18*X395"
Range("e405").Value = "=$W$19*X395"
Range("e406").Value = "=$X$15*X395"
Range("e413").Value = "=1*$W$14*X408"
Range("e414").Value = "=1*$W$15*X408"
Range("e415").Value = "=$W$16*X408"
Range("e416").Value = "=$W$17*X408"
Range("e417").Value = "=$W$18*X408"
Range("e418").Value = "=$W$19*X408"
Range("e419").Value = "=$X$15*X408"
Range("e426").Value = "=1*$W$14*X421"
Range("e427").Value = "=1*$W$15*X421"
Range("e428").Value = "=$W$16*X421"
Range("e429").Value = "=$W$17*X421"
Range("e430").Value = "=$W$18*X421"
Range("e431").Value = "=$W$19*X421"
Range("e432").Value = "=$X$15*X421"
Range("e439").Value = "=1*$W$14*X434"
Range("e440").Value = "=1*$W$15*X434"
Range("e441").Value = "=$W$16*X434"
Range("e442").Value = "=$W$17*X434"
Range("e443").Value = "=$W$18*X434"
Range("e444").Value = "=$W$19*X434"
Range("e445").Value = "=$X$15*X434"
Range("e452").Value = "=1*$W$14*X447"
Range("e453").Value = "=1*$W$15*X447"
Range("e454").Value = "=$W$16*X447"
Range("e455").Value = "=$W$17*X447"
Range("e456").Value = "=$W$18*X447"
Range("e457").Value = "=$W$19*X447"
Range("e458").Value = "=$X$15*X447"
Range("e465").Value = "=1*$W$14*X460"
Range("e466").Value = "=1*$W$15*X460"
Range("e467").Value = "=$W$16*X460"
Range("e468").Value = "=$W$17*X460"
Range("e469").Value = "=$W$18*X460"
Range("e470").Value = "=$W$19*X460"
Range("e471").Value = "=$X$15*X460"
Range("CA2:CC9").Select
Selection.ClearContents
Range("bz2").Value = 0
Range("b2").Select

Application.ScreenUpdating = True
MsgBox "All weights reset."

End Sub