Skip to content

Commit

Permalink
Saving Sub3 Analysis. To be continued...
Browse files Browse the repository at this point in the history
  • Loading branch information
jhustles committed Mar 18, 2020
1 parent 89d9fde commit bc8833a
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion VBA_Script_JG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,29 @@ Sub Analysis_3()
TotalStkVol = TotalStkVol + ws.Cells(Row, 7).Value

'Print Ticker Name in the Summary Table
ws.Range("I" & SummaryTableTick2).Value = Ticker
ws.Range("I" & SummaryTableTick2).Value = Ticker

'Print "YEARLY CHANGE" to Summary Table
ws.Range("J" & SummaryTableTick2).Value = TotalYearlyChange

'setting up condition that if the total yearly change is positive color the interior green
'otherwise if negative, color the interior red
If (TotalYearlyChange > 0) Then
ws.Range("J" & SummaryTableTick2).Interior.ColorIndex = 4
ElseIf (TotalYearlyChange = 0) Then
ws.Range("J" & SummaryTableTick2).Interior.ColorIndex = 2
Else
ws.Range("J" & SummaryTableTick2).Interior.ColorIndex = 3
End If

'Total PERCENT CHANGE - Need to account for If TotalYearlyChange = 0 (will cause an error)
If (TotalYearlyChange = 0) Then
ws.Range("K" & SummaryTableTick2).Value = 0
Else

'Print "Percent Change" to Summary Table = (totalcloseprice - totalopenprice)/ totalopenprice)
ws.Range("K" & SummaryTableTick2).Value = TotalYearlyChange / TotalOpenPrice

'Change format for Total Percentage Change to Percent style
ws.Range("K" & SummaryTableTick2).Style = "Percent"
End If

0 comments on commit bc8833a

Please sign in to comment.