' Application.ScreenUpdating = False Application.ScreenUpdating = True
consolidated
sheet to below. There is no sheet named consolidated. I think the author mixed it up with his function names.' This sub finishes setting up the ClosingPrices sheet.
'.RefreshOnFileOpen = False 'from macro
Note: If you change the month, or year, be sure to also CHOOSE A DAY. It is not automatically selected and will result in a former month/year to be selected
' Activate the ClosingPrices sheet. Worksheets("ClosingPrices").Activate
' Sets form user-input defaults
Dim seekSheet As Worksheet ' Makes sure that the Query Sheet was deleted last time On Error Resume Next Set seekSheet = Sheets("QuerySheet") If Not seekSheet Is Nothing Then Worksheets("QuerySheet").Delete End If ' Adds the temporary sheet, QuerySheet, which is used below to pull in the URL text Worksheets.Add ActiveSheet.Name = "QuerySheet"
' If cannot find the Adj Close column, put zeroes in columnc and, exit sub If AdjCloseCell Is Nothing Then ' put all 0's in column For counter = 1 To nPeriods ' FIXME put 0 in cell Next MsgBox "A non-critical error has occured. One of the stocks you entered had no history to return, or yahoo is giving an unexpected format. Results may be incorrect.", vbCritical, "Warning!" foundNothing = True Exit Sub End If
Public nPeriods As Integer