Option Explicit Private oInstance As MSXML2.DOMDocument60 Private m_InstanceURI As String Private m_strTaxonomyVersion As String Private m_strUSGAAP_TaxonomyVersion As String Private m_strInvest_TaxonomyVersion As String Private m_strDEI_TaxonomyVersion As String Private m_strContextForInstants As String Private m_strContextForDurations As String Private m_BalanceSheetDate As String Private m_IncomeStatementPeriodYTD As String Private m_Generator As String Private m_AccessionNumber As String Private m_DocumentPeriodEndDate As String Private m_DocumentPeriodEndDate_ContextID As String Private m_DocumentPeriodEndDate_startDate As String Private m_DocumentPeriodEndDate_endDate As String Private strEntityRegistrantName As String Private strEntityCentralIndexKey As String Private strEntityFilerCategory As String Private strTradingSymbol As String Private strCompanyFiscalYearEnd As String Private strFiscalYearFocus As String Private strFiscalPeriodFocus As String Private strDocumentType As String Private strBalanceSheetFormat As String Private strAssets As String Private strCurrentAssets As String Private strNoncurrentAssets As String Private strLiabilitiesAndEquity As String Private strLiabilities As String Private strCurrentLiabilities As String Private strNoncurrentLiabilities As String Private strCommitmentsAndContingencies As String Private strTemporaryEquity As String Private strEquity As String Private strEquityAttributableToParent As String Private strEquityAttributableToNoncontrollingInterest As String Private strRevenues As String Private strCostOfRevenue As String Private strGrossProfit As String Private strOperatingExpenses As String Private strOtherOperatingIncome As String Private strOperatingIncomeLoss As String Private strNonoperatingIncomeLoss As String Private strIncomeLossFromContinuingOperationsBeforeTax As String Private strIncomeTaxExpenseBenefit As String Private strIncomeLossFromContinuingOperationsAfterTax As String Private strIncomeLossFromDiscontinuedOperationsNetOfTax As String Private strExtraordinaryItemsOfIncomeExpenseNetOfTax As String Private strNetIncomeLoss As String Private strNetIncomeLossAttributableToParent As String Private strNetIncomeLossAttributableToNoncontrollingInterest As String Private strPreferredStockDividendsAndOtherAdjustments As String Private strNetIncomeLossAvailableToCommonStockholdersBasic As String Private strOtherComprehensiveIncomeLoss As String Private strComprehensiveIncomeLoss As String Private strComprehensiveIncomeLossAttributableToParent As String Private strComprehensiveIncomeLossAttributableToNoncontrollingInterest As String Private strNetCashFlow As String Private strNetCashFlowsOperating As String Private strNetCashFlowsInvesting As String Private strNetCashFlowsFinancing As String Private strNetCashFlowsOperatingContinuing As String Private strNetCashFlowsInvestingContinuing As String Private strNetCashFlowsFinancingContinuing As String Private strNetCashFlowsOperatingDiscontinued As String Private strNetCashFlowsInvestingDiscontinued As String Private strNetCashFlowsFinancingDiscontinued As String Private strNetCashFlowsContinuing Private strNetCashFlowsDiscontinued Private strExchangeGainsLosses Function TestComparison() RunComparison End Function Sub RunComparison() Worksheets("Compare").Activate 'Delete existing information (but NOT the first row which has the formats) Rows("7:6000").Select Selection.Delete Shift:=xlUp InitializeSpreadsheetInformation Dim intListRow As Integer Dim intCompareRow As Integer intListRow = 2 intCompareRow = 6 Dim oSheet_List As Worksheet Set oSheet_List = Worksheets("List") 'Set oSheet_List = Worksheets("List_Errors_DontSync") Dim oSheet_Comparison As Worksheet Set oSheet_Comparison = Worksheets("Compare") Do While Not (IsEmpty(oSheet_List.Cells(intListRow, 1))) 'Debug.Print intListRow 'Debug.Print oSheet_List.Cells(intListRow, 1).Value Dim strCIK As String strCIK = oSheet_List.Cells(intListRow, 1).Value Dim strGenerator As String strGenerator = oSheet_List.Cells(intListRow, 5).Value m_Generator = strGenerator m_AccessionNumber = oSheet_List.Cells(intListRow, 4).Value 'Format the row... Rows("6:6").Select Selection.Copy Rows(intCompareRow & ":" & intCompareRow).Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False oSheet_Comparison.Cells(intCompareRow, 1).Value = (intCompareRow - 5) GetInformation oSheet_List.Cells(intListRow, 3).Value, intCompareRow - 6 intListRow = intListRow + 1 intCompareRow = intCompareRow + 1 Loop 'MsgBox "Comparison completed successfully", vbInformation End Sub Private Sub InitializeSpreadsheetInformation() On Error GoTo ErrorHandler Range("LinkToXBRLInstance").Value = "" Range("LinkToXBRLCloudViewer").Value = "" Range("BalanceSheetFormat").Value = "" Range("IncomeStatementFormat").Value = "" 'General Range("EntityRegistrantName").Value = "" Range("CIK").Value = "" Range("EntityFilerCategory").Value = "" Range("TradingSymbol").Value = "" Range("CompanyFiscalYearEnd").Value = "" Range("FiscalYearFocus").Value = "" Range("FiscalPeriodFocus").Value = "" Range("DocumentType").Value = "" Range("BalanceSheetDate").Value = "" Range("IncomeStatementPeriodYTD").Value = "" 'Balance sheet Range("Assets").Value = 0 Range("CurrentAssets").Value = 0 Range("NoncurrentAssets").Value = 0 Range("Liabilities").Value = 0 Range("CurrentLiabilities").Value = 0 Range("NoncurrentLiabilities").Value = 0 Range("Equity").Value = 0 Range("EquityAttributableToParent").Value = 0 Range("EquityAttributableToNoncontrollingInterest").Value = 0 Range("LiabilitiesAndEquity").Value = 0 Range("CommitmentsAndContingencies").Value = 0 Range("TemporaryEquity").Value = 0 'Income statement Range("Revenues").Value = 0 Range("CostOfRevenues").Value = 0 Range("GrossProfit").Value = 0 Range("OperatingExpenses").Value = 0 Range("OtherOperatingIncome").Value = 0 Range("OperatingIncomeLoss").Value = 0 Range("NonoperatingIncomeLoss").Value = 0 Range("IncomeLossFromContinuingOperationsBeforeTax").Value = 0 Range("IncomeTaxExpenseBenefit").Value = 0 Range("IncomeLossFromContinuingOperationsAfterTax").Value = 0 Range("IncomeLossFromDiscontinuedOperationsNetOfTax").Value = 0 Range("ExtraordinaryItemsOfIncomeExpenseNetOfTax").Value = 0 Range("NetIncomeLoss").Value = 0 Range("NetIncomeLossAttributableToParent").Value = 0 Range("NetIncomeLossAttributableToNoncontrollingInterest").Value = 0 Range("PreferredStockDividendsAndOtherAdjustments").Value = 0 Range("NetIncomeLossAvailableToCommonStockholdersBasic").Value = 0 'Statement of Comprehensive Income Range("NetIncomeLoss2").Value = 0 Range("OtherComprehensiveIncomeLoss").Value = 0 Range("ComprehensiveIncomeLoss").Value = 0 Range("ComprehensiveIncomeLossAttributableToParent").Value = 0 Range("ComprehensiveIncomeLossAttributableToNoncontrollingInterest").Value = 0 'Cash flow statement Range("NetCashFlowsOperatingContinuing").Value = 0 Range("NetCashFlowsOperatingDiscontinued").Value = 0 Range("NetCashFlowsOperating").Value = 0 Range("NetCashFlowsInvestingContinuing").Value = 0 Range("NetCashFlowsInvestingDiscontinued").Value = 0 Range("NetCashFlowsInvesting").Value = 0 Range("NetCashFlowsFinancingContinuing").Value = 0 Range("NetCashFlowsFinancingDiscontinued").Value = 0 Range("NetCashFlowsFinancing").Value = 0 Range("NetCashFlowsContinuing").Value = 0 Range("NetCashFlowsDiscontinued").Value = 0 Range("ExchangeGainsLosses").Value = 0 Range("NetCashFlow").Value = 0 'Key ratios Range("SustainableGrowthRate").Value = 0 Range("ReturnOnAssets").Value = 0 Range("ReturnOnEquity").Value = 0 Range("ReturnOnSales").Value = 0 'Checks Range("Check_BS1").Value = "" Range("Check_BS2").Value = "" Range("Check_BS3").Value = "" Range("Check_BS4").Value = "" Range("Check_BS5").Value = "" Range("Check_IS1").Value = "" Range("Check_IS2").Value = "" Range("Check_IS3").Value = "" Range("Check_IS4").Value = "" Range("Check_IS5").Value = "" Range("Check_IS6").Value = "" Range("Check_IS7").Value = "" Range("Check_IS8").Value = "" Range("Check_IS9").Value = "" Range("Check_IS10").Value = "" Range("Check_CF1").Value = "" Range("Check_CF2").Value = "" Range("Check_CF3").Value = "" Range("Check_CF4").Value = "" Range("Check_CF5").Value = "" Range("Check_CF6").Value = "" 'Green = 5296274 'Yellow = 65535 Range("Check_BS1").Offset(0, 0).Interior.Color = 5296274 Range("Check_BS2").Offset(0, 0).Interior.Color = 5296274 Range("Check_BS3").Offset(0, 0).Interior.Color = 5296274 Range("Check_BS4").Offset(0, 0).Interior.Color = 5296274 Range("Check_BS5").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS1").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS2").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS3").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS4").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS5").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS6").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS7").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS8").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS9").Offset(0, 0).Interior.Color = 5296274 Range("Check_IS10").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF1").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF2").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF3").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF4").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF5").Offset(0, 0).Interior.Color = 5296274 Range("Check_CF6").Offset(0, 0).Interior.Color = 5296274 Exit Sub ErrorHandler: If Err.Number <> 91 Then Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub Private Sub GetInformation(strXBRLInstanceLocation As String, intRow As Long) On Error GoTo ErrorHandler strXBRLInstanceLocation = Replace(strXBRLInstanceLocation, "http:", "https:") strXBRLInstanceLocation = Replace(strXBRLInstanceLocation, ".htm", "_htm.xml") m_InstanceURI = strXBRLInstanceLocation 'Load XBRL instance into memory LoadXBRLInstanceIntoMemory strXBRLInstanceLocation DoEvents 'Debug.Print "XBRL instance loaded successfully: " & strInstanceLocation GetBaseInformation intRow GetCurrentPeriodAndContextInformation intRow Debug.Print " " Debug.Print "FUNDAMENTAL ACCOUNTING CONCEPTS CHECK REPORT:" Debug.Print "XBRL instance: " & strXBRLInstanceLocation Debug.Print "XBRL Cloud Viewer: https://edgardashboard.xbrlcloud.com/flex/viewer/XBRLViewer.html#instance=" & strXBRLInstanceLocation Debug.Print "US GAAP Taxonomy version: " & m_strUSGAAP_TaxonomyVersion Debug.Print "DEI Taxonomy version: " & m_strDEI_TaxonomyVersion Debug.Print "Entity registrant name: " & strEntityRegistrantName Debug.Print "CIK: " & strEntityCentralIndexKey Debug.Print "Entity filer category: " & strEntityFilerCategory Debug.Print "Trading symbol: " & strTradingSymbol Debug.Print "Company fiscal year end: " & strCompanyFiscalYearEnd Debug.Print "Fiscal year focus: " & strFiscalYearFocus Debug.Print "Fiscal period focus: " & strFiscalPeriodFocus Debug.Print "Document type: " & strDocumentType Debug.Print "Balance Sheet Date (document period end date): " & m_BalanceSheetDate Debug.Print "Income Statement Period (YTD, current period, period start date): " & m_IncomeStatementPeriodYTD & " to " & m_BalanceSheetDate Debug.Print "Context ID for document period focus (instants): " & m_strContextForInstants Debug.Print "Context ID for YTD period (durations): " & m_strContextForDurations Debug.Print " " GetInformation_BalanceSheet intRow GetInformation_IncomeStatement intRow GetInformation_CashFlowStatement intRow GetInformation_KeyRatios intRow 'Debug.Print "XBRL Cloud Viewer: https://edgardashboard.xbrlcloud.com/flex/viewer/XBRLViewer.html#instance=" & m_InstanceURI Range("LinkToXBRLInstance").Offset(intRow, 0) = "'" & m_InstanceURI 'Range("LinkToXBRLCloudViewer").Offset(intRow, 0).Value = "https://edgardashboard.xbrlcloud.com/flex/viewer/XBRLViewer.html#instance=" & m_InstanceURI Range("LinkToXBRLCloudViewer").Offset(intRow, 0).Value = "https://edgardashboard.xbrlcloud.com/flex/viewer/XBRLViewer.html#instance=" & Replace(m_InstanceURI, "https:", "http:") Range("Generator").Offset(intRow, 0).Value = m_Generator Range("AccessionNumber").Offset(intRow, 0).Value = m_AccessionNumber Exit Sub ErrorHandler: If Err.Number <> 91 Or Err.Number <> 6 Or Err.Number <> 11 Then 'Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub Private Function LoadXBRLInstanceIntoMemory(strInstanceLocation As String) On Error GoTo ErrorHandler Set oInstance = Nothing Set oInstance = New MSXML2.DOMDocument60 oInstance.async = False oInstance.validateOnParse = False oInstance.Load (strInstanceLocation) DoEvents If oInstance.parseError.ErrorCode <> 0 Then Debug.Print "Error loading file: " & vbCrLf & vbCrLf & _ "File URL: " & oInstance.parseError.URL & vbCrLf & _ "Error Code: " & oInstance.parseError.ErrorCode & vbCrLf & _ "Error Description: " & oInstance.parseError.reason & vbCrLf _ , vbCritical End If 'The XBRL instance is loaded into memory as a global variable and now can be accessed 'MsgBox "File loaded: " & strInstanceLocation & " " & vbCrLf & vbCrLf & oInstance.XML Exit Function ErrorHandler: If Err.Number <> 91 Then Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Function Private Sub GetBaseInformation(intRow As Long) On Error GoTo ErrorHandler 'This gets the taxonomy version m_strContextForInstants = "ERROR" m_strContextForDurations = "ERROR" 'Taxonomy version (Figures out which version of taxonomy is being used) Dim strEntireInstanceDocument_TEMP As String Dim strTaxonomyVersion As String Dim strUSGAAP_TaxonomyVersion As String Dim strDEI_TaxonomyVersion As String strEntityRegistrantName = "ERROR" strTaxonomyVersion = "ERROR" strUSGAAP_TaxonomyVersion = "ERROR" strDEI_TaxonomyVersion = "ERROR" 'This differentiates between the 2015, 2014, 2013, 2012, 2011, and 2009 US GAAP taxonomies... 'Brute force method for finding the namespaces (text search of XML) strEntireInstanceDocument_TEMP = oInstance.XML '0=not found; 'US GAAP Taxonomy If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2017-01-31") <> 0 Then 'Uses the 2017 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2017-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2014-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2016-01-31") <> 0 Then 'Uses the 2016 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2016-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2014-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2015-01-31") <> 0 Then 'Uses the 2015 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2015-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2014-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2014-01-31") <> 0 Then 'Uses the 2014 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2014-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2014-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2013-01-31") <> 0 Then 'Uses the 2013 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2013-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2013-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2012-01-31") <> 0 Then 'Uses the 2012 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2012-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2012-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://fasb.org/us-gaap/2011-01-31") <> 0 Then 'Uses the 2011 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2011-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2011-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.us/us-gaap/2009-01-31") <> 0 Then 'Uses the 2009 US GAAP taxonomy m_strUSGAAP_TaxonomyVersion = "http://xbrl.us/us-gaap/2009-01-31" m_strInvest_TaxonomyVersion = "http://xbrl.us/invest/2019-01-31" End If 'DEI Taxonomy If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.sec.gov/dei/2014-01-31") <> 0 Then 'Uses the 2014 DEI taxonomy m_strDEI_TaxonomyVersion = "http://xbrl.sec.gov/dei/2014-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.sec.gov/dei/2013-01-31") <> 0 Then 'Uses the 2013 DEI taxonomy m_strDEI_TaxonomyVersion = "http://xbrl.sec.gov/dei/2013-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.sec.gov/dei/2012-01-31") <> 0 Then 'Uses the 2012 DEI taxonomy m_strDEI_TaxonomyVersion = "http://xbrl.sec.gov/dei/2012-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.sec.gov/dei/2011-01-31") <> 0 Then 'Uses the 2011 DEI taxonomy m_strDEI_TaxonomyVersion = "http://xbrl.sec.gov/dei/2011-01-31" End If If InStr(1, strEntireInstanceDocument_TEMP, "http://xbrl.us/dei/2009-01-31") <> 0 Then 'Uses the 2009 DEI taxonomy m_strDEI_TaxonomyVersion = "http://xbrl.us/dei/2009-01-31" End If 'Sets the namespaces for the XML document oInstance.SetProperty "SelectionNamespaces", "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xbrli='http://www.xbrl.org/2003/instance' xmlns='http://www.xbrl.org/2003/instance' xmlns:xbrldi='http://xbrl.org/2006/xbrldi' xmlns:us-gaap='" & m_strUSGAAP_TaxonomyVersion & "' xmlns:dei='" & m_strDEI_TaxonomyVersion & "' xmlns:currency='http://xbrl.sec.gov/currency/2012-01-31' xmlns:invest='" & m_strInvest_TaxonomyVersion & "'" 'Variables used Dim oNodeList As MSXML2.IXMLDOMNodeList Dim strSeekConcept As String 'Registered Name (required, exists only once) strEntityRegistrantName = oInstance.SelectSingleNode("//dei:EntityRegistrantName").Text 'EntityCentralIndexKey (required, exists only once) strEntityCentralIndexKey = oInstance.SelectSingleNode("//dei:EntityCentralIndexKey").Text 'EntityFilerCategory (required, but a few filers don't provide) strEntityFilerCategory = oInstance.SelectSingleNode("//dei:EntityFilerCategory").Text 'Company fiscal year end (required) strCompanyFiscalYearEnd = oInstance.SelectSingleNode("//dei:CurrentFiscalYearEndDate").Text 'FiscalYearFocus (required) strFiscalYearFocus = oInstance.SelectSingleNode("//dei:DocumentFiscalYearFocus").Text 'FiscalPeriodFocus (required) strFiscalPeriodFocus = oInstance.SelectSingleNode("//dei:DocumentFiscalPeriodFocus").Text 'DocumentType (required, but a few filers don't provide) strDocumentType = oInstance.SelectSingleNode("//dei:DocumentType").Text 'TradingSymbol(optional) Set oNodeList = oInstance.SelectNodes("//dei:TradingSymbol[@contextRef]") 'MsgBox oNodeList.length If oNodeList.Length > 0 Then strTradingSymbol = oInstance.SelectSingleNode("//dei:TradingSymbol").Text Else strTradingSymbol = "Not provided" End If Range("EntityRegistrantName").Offset(intRow, 0).Value = strEntityRegistrantName Range("CIK").Offset(intRow, 0).Value = Chr(39) & strEntityCentralIndexKey Range("EntityFilerCategory").Offset(intRow, 0).Value = strEntityFilerCategory Range("TradingSymbol").Offset(intRow, 0).Value = strTradingSymbol Range("CompanyFiscalYearEnd").Offset(intRow, 0).Value = Chr(39) & strCompanyFiscalYearEnd Range("FiscalYearFocus").Offset(intRow, 0).Value = Chr(39) & strFiscalYearFocus Range("FiscalPeriodFocus").Offset(intRow, 0).Value = strFiscalPeriodFocus Range("DocumentType").Offset(intRow, 0).Value = strDocumentType Range("BalanceSheetDate").Offset(intRow, 0).Value = Chr(39) & m_BalanceSheetDate 'Income statement date is set elsewhere Exit Sub ErrorHandler: If Err.Number <> 91 Then Debug.Print "Error number " & Err.Number & ": " & Err.Description End If Resume Next End Sub Private Sub GetCurrentPeriodAndContextInformation(intRow As Long) 'Figures out the current period and contexts for the current period instance/duration contexts On Error GoTo ErrorHandler m_BalanceSheetDate = "ERROR" m_IncomeStatementPeriodYTD = "ERROR" m_strContextForInstants = "ERROR" m_strContextForDurations = "ERROR" m_DocumentPeriodEndDate = "ERROR" m_DocumentPeriodEndDate_ContextID = "ERROR" m_DocumentPeriodEndDate_startDate = "ERROR" m_DocumentPeriodEndDate_endDate = "ERROR" 'Get the value of the dei:DocumentPeriodEndDate m_DocumentPeriodEndDate = oInstance.SelectSingleNode("//dei:DocumentPeriodEndDate").Text 'Get the context ID of the dei:DocumentPeriodEndDate m_DocumentPeriodEndDate_ContextID = oInstance.SelectSingleNode("//dei:DocumentPeriodEndDate/@contextRef").Text 'Get the end date of the context for the fact dei:DocumentPeriodEndDate m_DocumentPeriodEndDate_endDate = oInstance.SelectSingleNode("//xbrli:context[@id='" & oInstance.SelectSingleNode("//dei:DocumentPeriodEndDate/@contextRef").Text & "']/xbrli:period/xbrli:endDate").Text 'Get the start date of the context for the fact dei:DocumentPeriodEndDate m_DocumentPeriodEndDate_startDate = oInstance.SelectSingleNode("//xbrli:context[@id='" & oInstance.SelectSingleNode("//dei:DocumentPeriodEndDate/@contextRef").Text & "']/xbrli:period/xbrli:startDate").Text 'Look through all the instant contexts for the context which 'is the current balance sheed date context and get the context ID: Dim oNode As IXMLDOMNode Dim oNodeList As IXMLDOMNodeList Set oNodeList = oInstance.SelectNodes("//xbrli:context[xbrli:period/xbrli:instant][not(xbrli:entity/xbrli:segment)]") 'MsgBox oNodeList.Length For Each oNode In oNodeList Dim strContextInstantValue As String strContextInstantValue = oNode.SelectSingleNode("xbrli:period/xbrli:instant").Text Dim strMatchingID As String strMatchingID = "NO-MATCH" If strContextInstantValue = m_DocumentPeriodEndDate_endDate Then 'MsgBox "Match: " & oNode.SelectSingleNode("@id").Text strMatchingID = oNode.SelectSingleNode("@id").Text Exit For End If Next m_BalanceSheetDate = m_DocumentPeriodEndDate_endDate m_strContextForInstants = strMatchingID m_IncomeStatementPeriodYTD = m_DocumentPeriodEndDate_startDate m_strContextForDurations = oInstance.SelectSingleNode("//dei:DocumentPeriodEndDate/@contextRef").Text Range("IncomeStatementPeriodYTD").Offset(intRow, 0).Value = "'" & m_IncomeStatementPeriodYTD Exit Sub ErrorHandler: If Err.Number <> 91 Then Debug.Print "Error number " & Err.Number & ": " & Err.Description End If Resume Next End Sub Private Function GetFactValue(strSeekConcept As String, strConceptPeriodType As String) As String On Error GoTo ErrorHandler GetFactValue = "NOT-FOUND" 'Determine which context to use (instant or duration) Dim strContextReference As String If strConceptPeriodType = "Instant" Then 'Concept is an instance strContextReference = m_strContextForInstants ElseIf strConceptPeriodType = "Duration" Then 'Concept is a duration strContextReference = m_strContextForDurations Else 'An error occured GetFactValue = "CONTEXT ERROR" Exit Function End If Dim oNodeList As MSXML2.IXMLDOMNodeList Set oNodeList = oInstance.SelectNodes("//" & strSeekConcept & "[@contextRef='" & strContextReference & "']") 'Invoked if there are duplicate facts If oNodeList.Length > 1 Then 'MsgBox strSeekConcept & " " & oNodeList.Length 'MsgBox oInstance.SelectSingleNode("//" & strSeekConcept & "[@contextRef='" & strContextReference & "']").Text 'MsgBox oNodeList.Item(0).XML 'MsgBox oNodeList.Item(1).XML 'MsgBox "THREE: " & oInstance.SelectSingleNode("//" & strSeekConcept & "[@contextRef='" & strContextReference & "'][@decimals='-3']" & "|" & "//" & strSeekConcept & "[@contextRef='" & strContextReference & "'][@decimals='-6']").Text GetFactValue = oInstance.SelectSingleNode("//" & strSeekConcept & "[@contextRef='" & strContextReference & "'][@decimals='-3']" & "|" & "//" & strSeekConcept & "[@contextRef='" & strContextReference & "'][@decimals='-6']").Text Exit Function End If If oNodeList.Length > 0 Then GetFactValue = oInstance.SelectSingleNode("//" & strSeekConcept & "[@contextRef='" & strContextReference & "']").Text 'If the concept exists and @nil is true, set the value to 0 If oInstance.SelectSingleNode("//" & strSeekConcept & "[@contextRef='" & strContextReference & "']/@xsi:nil").Text = "true" Then 'Set the value to ZERO if it is nil GetFactValue = 0 End If End If Exit Function ErrorHandler: If Err.Number <> 91 Then Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Function Private Sub GetInformation_BalanceSheet(intRow As Long) strBalanceSheetFormat = "Not determined" strAssets = "NOT-FOUND" strCurrentAssets = "NOT-FOUND" strNoncurrentAssets = "NOT-FOUND" strLiabilitiesAndEquity = "NOT-FOUND" strLiabilities = "NOT-FOUND" strCurrentLiabilities = "NOT-FOUND" strNoncurrentLiabilities = "NOT-FOUND" strCommitmentsAndContingencies = "NOT-FOUND" strTemporaryEquity = "NOT-FOUND" strEquity = "NOT-FOUND" strEquityAttributableToParent = "NOT-FOUND" strEquityAttributableToNoncontrollingInterest = "NOT-FOUND" 'Assets strAssets = IIf(strAssets = "NOT-FOUND", GetFactValue("us-gaap:Assets", "Instant"), strAssets) strAssets = IIf(strAssets = "NOT-FOUND", GetFactValue("us-gaap:AssetsCurrent", "Instant"), strAssets) strAssets = IIf(strAssets = "NOT-FOUND", "0", strAssets) 'CurrentAssets strCurrentAssets = IIf(strCurrentAssets = "NOT-FOUND", GetFactValue("us-gaap:AssetsCurrent", "Instant"), strCurrentAssets) strCurrentAssets = IIf(strCurrentAssets = "NOT-FOUND", "0", strCurrentAssets) 'NoncurrentAssets strNoncurrentAssets = IIf(strNoncurrentAssets = "NOT-FOUND", GetFactValue("us-gaap:AssetsNoncurrent", "Instant"), strNoncurrentAssets) strNoncurrentAssets = IIf(strNoncurrentAssets = "NOT-FOUND", "0", strNoncurrentAssets) 'Liabilities strLiabilities = IIf(strLiabilities = "NOT-FOUND", GetFactValue("us-gaap:Liabilities", "Instant"), strLiabilities) strLiabilities = IIf(strLiabilities = "NOT-FOUND", "0", strLiabilities) 'CurrentLiabilities strCurrentLiabilities = IIf(strCurrentLiabilities = "NOT-FOUND", GetFactValue("us-gaap:LiabilitiesCurrent", "Instant"), strCurrentLiabilities) strCurrentLiabilities = IIf(strCurrentLiabilities = "NOT-FOUND", "0", strCurrentLiabilities) 'NoncurrentLiabilities strNoncurrentLiabilities = IIf(strNoncurrentLiabilities = "NOT-FOUND", GetFactValue("us-gaap:LiabilitiesNoncurrent", "Instant"), strNoncurrentLiabilities) strNoncurrentLiabilities = IIf(strNoncurrentLiabilities = "NOT-FOUND", "0", strNoncurrentLiabilities) 'CommitmentsAndContingencies strCommitmentsAndContingencies = IIf(strCommitmentsAndContingencies = "NOT-FOUND", GetFactValue("us-gaap:CommitmentsAndContingencies", "Instant"), strCommitmentsAndContingencies) strCommitmentsAndContingencies = IIf(strCommitmentsAndContingencies = "NOT-FOUND", "0", strCommitmentsAndContingencies) 'TemporaryEquity strTemporaryEquity = IIf(strTemporaryEquity = "NOT-FOUND", GetFactValue("us-gaap:TemporaryEquityCarryingAmountIncludingPortionAttributableToNoncontrollingInterests", "Instant"), strTemporaryEquity) strTemporaryEquity = IIf(strTemporaryEquity = "NOT-FOUND", GetFactValue("us-gaap:RedeemablePreferredStockCarryingAmount", "Instant"), strTemporaryEquity) strTemporaryEquity = IIf(strTemporaryEquity = "NOT-FOUND", GetFactValue("us-gaap:TemporaryEquityValueExcludingAdditionalPaidInCapital", "Instant"), strTemporaryEquity) strTemporaryEquity = IIf(strTemporaryEquity = "NOT-FOUND", "0", strTemporaryEquity) 'Equity strEquity = IIf(strEquity = "NOT-FOUND", GetFactValue("us-gaap:StockholdersEquityIncludingPortionAttributableToNoncontrollingInterest", "Instant"), strEquity) strEquity = IIf(strEquity = "NOT-FOUND", GetFactValue("us-gaap:PartnersCapitalIncludingPortionAttributableToNoncontrollingInterest", "Instant"), strEquity) strEquity = IIf(strEquity = "NOT-FOUND", GetFactValue("us-gaap:LimitedLiabilityCompanyLlcMembersEquityIncludingPortionAttributableToNoncontrollingInterest", "Instant"), strEquity) strEquity = IIf(strEquity = "NOT-FOUND", "0", strEquity) 'EquityAttributableToParent strEquityAttributableToParent = IIf(strEquityAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:StockholdersEquity", "Instant"), strEquityAttributableToParent) strEquityAttributableToParent = IIf(strEquityAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:PartnersCapital", "Instant"), strEquityAttributableToParent) strEquityAttributableToParent = IIf(strEquityAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:MembersEquity", "Instant"), strEquityAttributableToParent) strEquityAttributableToParent = IIf(strEquityAttributableToParent = "NOT-FOUND", "0", strEquityAttributableToParent) 'EquityAttributableToNoncontrollingInterest strEquityAttributableToNoncontrollingInterest = IIf(strEquityAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:MinorityInterest", "Instant"), strEquityAttributableToNoncontrollingInterest) strEquityAttributableToNoncontrollingInterest = IIf(strEquityAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:PartnersCapitalAttributableToNoncontrollingInterest", "Instant"), strEquityAttributableToNoncontrollingInterest) strEquityAttributableToNoncontrollingInterest = IIf(strEquityAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:MembersEquityAttributableToNoncontrollingInterest", "Instant"), strEquityAttributableToNoncontrollingInterest) strEquityAttributableToNoncontrollingInterest = IIf(strEquityAttributableToNoncontrollingInterest = "NOT-FOUND", "0", strEquityAttributableToNoncontrollingInterest) 'LiabilitiesAndEquity strLiabilitiesAndEquity = IIf(strLiabilitiesAndEquity = "NOT-FOUND", GetFactValue("us-gaap:LiabilitiesAndStockholdersEquity", "Instant"), strLiabilitiesAndEquity) strLiabilitiesAndEquity = IIf(strLiabilitiesAndEquity = "NOT-FOUND", GetFactValue("us-gaap:LiabilitiesAndPartnersCapital", "Instant"), strLiabilitiesAndEquity) strLiabilitiesAndEquity = IIf(strLiabilitiesAndEquity = "NOT-FOUND", "0", strLiabilitiesAndEquity) 'These are temporary variables, not fundamental accounting concepts 'RedeemableNoncontrollingInterest (Temporary variable) Dim strRedeemableNoncontrollingInterest As String strRedeemableNoncontrollingInterest = "NOT-FOUND" strRedeemableNoncontrollingInterest = IIf(strRedeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityCarryingAmount", "Instant"), strRedeemableNoncontrollingInterest) strRedeemableNoncontrollingInterest = IIf(strRedeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityFairValue", "Instant"), strRedeemableNoncontrollingInterest) strRedeemableNoncontrollingInterest = IIf(strRedeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityOtherFairValue", "Instant"), strRedeemableNoncontrollingInterest) strRedeemableNoncontrollingInterest = IIf(strRedeemableNoncontrollingInterest = "NOT-FOUND", "0", strRedeemableNoncontrollingInterest) 'TemporaryEquityAttributableToParent (Temporary variable) Dim strTemporaryEquityAttributableToParent As String strTemporaryEquityAttributableToParent = "NOT-FOUND" strTemporaryEquityAttributableToParent = IIf(strTemporaryEquityAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:TemporaryEquityCarryingAmountAttributableToParent", "Instant"), strTemporaryEquityAttributableToParent) strTemporaryEquityAttributableToParent = IIf(strTemporaryEquityAttributableToParent = "NOT-FOUND", "0", strTemporaryEquityAttributableToParent) 'RedeemableNoncontrollingInterestCommon (Temporary variable) Dim strRedeemableNoncontrollingInterestCommon As String strRedeemableNoncontrollingInterestCommon = "NOT-FOUND" strRedeemableNoncontrollingInterestCommon = IIf(strRedeemableNoncontrollingInterestCommon = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityCommonCarryingAmount", "Instant"), strRedeemableNoncontrollingInterestCommon) strRedeemableNoncontrollingInterestCommon = IIf(strRedeemableNoncontrollingInterestCommon = "NOT-FOUND", "0", strRedeemableNoncontrollingInterestCommon) 'RedeemableNoncontrollingInterestPreferred (Temporary variable) Dim strRedeemableNoncontrollingInterestPreferred As String strRedeemableNoncontrollingInterestPreferred = "NOT-FOUND" strRedeemableNoncontrollingInterestPreferred = IIf(strRedeemableNoncontrollingInterestPreferred = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityPreferredCarryingAmount", "Instant"), strRedeemableNoncontrollingInterestPreferred) strRedeemableNoncontrollingInterestPreferred = IIf(strRedeemableNoncontrollingInterestPreferred = "NOT-FOUND", "0", strRedeemableNoncontrollingInterestPreferred) 'RedeemableNoncontrollingInterestOther (Temporary) Dim strRedeemableNoncontrollingInterestOther As String strRedeemableNoncontrollingInterestOther = "NOT-FOUND" strRedeemableNoncontrollingInterestOther = IIf(strRedeemableNoncontrollingInterestOther = "NOT-FOUND", GetFactValue("us-gaap:RedeemableNoncontrollingInterestEquityOtherCarryingAmount", "Instant"), strRedeemableNoncontrollingInterestOther) strRedeemableNoncontrollingInterestOther = IIf(strRedeemableNoncontrollingInterestOther = "NOT-FOUND", "0", strRedeemableNoncontrollingInterestOther) 'Balance sheet impute rules 'BS-Impute-101: If CDbl(strRedeemableNoncontrollingInterest) = 0 Then strRedeemableNoncontrollingInterest = CDbl(strRedeemableNoncontrollingInterestCommon) + CDbl(strRedeemableNoncontrollingInterestPreferred) + CDbl(strRedeemableNoncontrollingInterestOther) End If 'BS-Impute-102: If CDbl(strTemporaryEquity) = 0 Then strTemporaryEquity = CDbl(strTemporaryEquityAttributableToParent) + CDbl(strRedeemableNoncontrollingInterest) End If 'BS-Impute-103: If CDbl(strAssets) = 0 And CDbl(strNoncurrentAssets) = 0 And CDbl(strAssets) <> CDbl(strLiabilitiesAndEquity) And CDbl(strCurrentAssets) = CDbl(strLiabilitiesAndEquity) Then strAssets = CDbl(strCurrentAssets) End If 'BS-Impute-104: If CDbl(strAssets) = 0 And CDbl(strLiabilitiesAndEquity) <> 0 And CDbl(strCurrentAssets) = CDbl(strLiabilitiesAndEquity) Then strAssets = CDbl(strCurrentAssets) End If 'BS-Impute-105: If CDbl(strAssets) = 0 And CDbl(strNoncurrentAssets) = 0 And CDbl(strLiabilitiesAndEquity) <> 0 And CDbl(strLiabilitiesAndEquity) = (CDbl(strLiabilities) + CDbl(strEquity)) Then strAssets = CDbl(strCurrentAssets) End If 'BS-Impute-106: If CDbl(strNoncurrentAssets) = 0 And CDbl(strAssets) <> 0 And CDbl(strCurrentAssets) <> 0 Then strNoncurrentAssets = CDbl(strAssets) - CDbl(strCurrentAssets) End If 'BS-Impute-107: If CDbl(strLiabilitiesAndEquity) = 0 And CDbl(strAssets) <> 0 Then strLiabilitiesAndEquity = CDbl(strAssets) End If 'BS-Impute-108: If CDbl(strEquity) = 0 And CDbl(strEquityAttributableToNoncontrollingInterest) <> 0 And CDbl(strEquityAttributableToParent) <> 0 Then strEquity = CDbl(strEquityAttributableToParent) + CDbl(strEquityAttributableToNoncontrollingInterest) End If 'BS-Impute-109: If CDbl(strEquity) = 0 And CDbl(strEquityAttributableToNoncontrollingInterest) = 0 And CDbl(strEquityAttributableToParent) <> 0 Then strEquity = CDbl(strEquityAttributableToParent) End If 'BS-Impute-110: If CDbl(strEquity) = 0 Then strEquity = CDbl(strEquityAttributableToParent) + CDbl(strEquityAttributableToNoncontrollingInterest) End If 'BS-Impute-111: (FIXED changed <> to = for EquityAttributableToParent +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ If CDbl(strEquityAttributableToParent) = 0 And CDbl(strEquity) <> 0 And CDbl(strEquityAttributableToNoncontrollingInterest) <> 0 Then strEquityAttributableToParent = CDbl(strEquity) - CDbl(strEquityAttributableToNoncontrollingInterest) End If 'BS-Impute-112: If CDbl(strEquityAttributableToParent) = 0 And CDbl(strEquity) <> 0 And CDbl(strEquityAttributableToNoncontrollingInterest) = 0 Then strEquityAttributableToParent = CDbl(strEquity) End If 'BS-Impute-113: If CDbl(strNoncurrentLiabilities) = 0 And CDbl(strCurrentLiabilities) <> 0 And CDbl(strLiabilities) <> 0 Then strNoncurrentLiabilities = CDbl(strLiabilities) - CDbl(strCurrentLiabilities) End If 'BS-Impute-114: If CDbl(strLiabilities) = 0 And CDbl(strCurrentLiabilities) <> 0 And CDbl(strNoncurrentLiabilities) <> 0 Then strLiabilities = CDbl(strCurrentLiabilities) + CDbl(strNoncurrentLiabilities) End If 'BS-Impute-115: If CDbl(strLiabilities) = 0 And CDbl(strEquity) <> 0 Then strLiabilities = CDbl(strLiabilitiesAndEquity) - (CDbl(strCommitmentsAndContingencies) + CDbl(strTemporaryEquity) + CDbl(strEquity)) End If 'BS-Impute-116: (Run a SECOND TIME in case total liabilities was not yet known) If CDbl(strNoncurrentLiabilities) = 0 And CDbl(strCurrentLiabilities) <> 0 And CDbl(strLiabilities) <> 0 Then strNoncurrentLiabilities = CDbl(strLiabilities) - CDbl(strCurrentLiabilities) End If 'BS-Impute-117: If CDbl(strLiabilities) = 0 And CDbl(strCurrentLiabilities) <> 0 And CDbl(strNoncurrentLiabilities) = 0 Then strLiabilities = CDbl(strCurrentLiabilities) End If 'BS-Impute-118: If CDbl(strEquityAttributableToParent) <> 0 And CDbl(strEquity) <> 0 And CDbl(strEquityAttributableToNoncontrollingInterest) <> 0 And CDbl(strEquityAttributableToParent) = CDbl(strEquity) Then strEquityAttributableToParent = CDbl(strEquity) - CDbl(strEquityAttributableToNoncontrollingInterest) End If 'BS-Impute-119: If CDbl(strCurrentLiabilities) = 0 And CDbl(strNoncurrentLiabilities) = 0 And CDbl(strLiabilities) <> 0 Then strCurrentLiabilities = CDbl(strLiabilities) End If 'BS-Impute-120: If CDbl(strEquityAttributableToNoncontrollingInterest) = 0 And CDbl(strEquity) <> 0 And CDbl(strEquityAttributableToParent) <> 0 Then strEquityAttributableToNoncontrollingInterest = CDbl(strEquity) - CDbl(strEquityAttributableToParent) End If 'BS-Impute-121: If CDbl(strCurrentAssets) = 0 And CDbl(strAssets) <> 0 And CDbl(strLiabilitiesAndEquity) <> 0 And CDbl(strLiabilitiesAndEquity) = CDbl(strAssets) Then strCurrentAssets = CDbl(strAssets) End If 'BS-Impute-122: If CDbl(strTemporaryEquity) = 0 And CDbl(strLiabilities) <> 0 And CDbl(strEquity) <> 0 And CDbl(strLiabilitiesAndEquity) <> 0 And CDbl(strLiabilities) = (CDbl(strCurrentLiabilities) + CDbl(strNoncurrentLiabilities)) And CDbl(strEquity) = (CDbl(strEquityAttributableToParent) + CDbl(strEquityAttributableToNoncontrollingInterest)) Then strTemporaryEquity = CDbl(strLiabilitiesAndEquity) - ((CDbl(strLiabilities) + CDbl(strEquity)) - CDbl(strCommitmentsAndContingencies)) End If Debug.Print "Assets: " & strAssets Debug.Print "Current Assets: " & strCurrentAssets Debug.Print "Noncurrent Assets: " & strNoncurrentAssets Debug.Print "LiabilitiesAndEquity: " & strLiabilitiesAndEquity Debug.Print "Liabilities: " & strLiabilities Debug.Print "CurrentLiabilities: " & strCurrentLiabilities Debug.Print "NoncurrentLiabilities: " & strNoncurrentLiabilities Debug.Print "CommitmentsAndContingencies: " & strCommitmentsAndContingencies Debug.Print "Temporary equity: " & strTemporaryEquity Debug.Print "Equity: " & strEquity Debug.Print "Equity attributable to parent: " & strEquityAttributableToParent Debug.Print "Equity attributable to noncontrolling interest: " & strEquityAttributableToNoncontrollingInterest Debug.Print " " Dim lngBS1 As Double Dim lngBS2 As Double Dim lngBS3 As Double Dim lngBS4 As Double Dim lngBS5 As Double lngBS1 = CDbl(strEquity) - (CDbl(strEquityAttributableToParent) + CDbl(strEquityAttributableToNoncontrollingInterest)) lngBS2 = CDbl(strAssets) - CDbl(strLiabilitiesAndEquity) lngBS3 = CDbl(strAssets) - (CDbl(strCurrentAssets) + CDbl(strNoncurrentAssets)) lngBS4 = CDbl(strLiabilities) - (CDbl(strCurrentLiabilities) + CDbl(strNoncurrentLiabilities)) lngBS5 = CDbl(strLiabilitiesAndEquity) - (CDbl(strLiabilities) + CDbl(strCommitmentsAndContingencies) + CDbl(strTemporaryEquity) + CDbl(strEquity)) Debug.Print "BS1: Equity(" & strEquity & ") = EquityAttributableToParent(" & strEquityAttributableToParent & ") + EquityAttributableToNoncontrollingInterest(" & strEquityAttributableToNoncontrollingInterest & "): " & lngBS1 Debug.Print "BS2: Assets(" & strAssets & ") = LiabilitiesAndEquity(" & strLiabilitiesAndEquity & "): " & lngBS2 Debug.Print "BS3: Assets(" & strAssets & ") = CurrentAssets(" & strCurrentAssets & ") + NoncurrentAssets(" & strNoncurrentAssets & "): " & lngBS3 Debug.Print "BS4: Liabilities(" & strLiabilities & ")= CurrentLiabilities(" & strCurrentLiabilities & ") + NoncurrentLiabilities(" & strNoncurrentLiabilities & "): " & lngBS4 Debug.Print "BS5: Liabilities and Equity(" & strLiabilitiesAndEquity & ")= Liabilities(" & strLiabilities & ") + CommitmentsAndContingencies(" & strCommitmentsAndContingencies & ")+ TemporaryEquity(" & strTemporaryEquity & ")+ Equity(" & strEquity & "): " & lngBS5 Debug.Print " " 'Populate Excel 'Range("BalanceSheetFormat").Offset(intRow, 0).Value = strBalanceSheetFormat Range("Assets").Offset(intRow, 0).Value = strAssets Range("CurrentAssets").Offset(intRow, 0).Value = strCurrentAssets Range("NoncurrentAssets").Offset(intRow, 0).Value = strNoncurrentAssets Range("Liabilities").Offset(intRow, 0).Value = strLiabilities Range("CurrentLiabilities").Offset(intRow, 0).Value = strCurrentLiabilities Range("NoncurrentLiabilities").Offset(intRow, 0).Value = strNoncurrentLiabilities Range("Equity").Offset(intRow, 0).Value = strEquity Range("EquityAttributableToParent").Offset(intRow, 0).Value = strEquityAttributableToParent Range("EquityAttributableToNoncontrollingInterest").Offset(intRow, 0).Value = strEquityAttributableToNoncontrollingInterest Range("LiabilitiesAndEquity").Offset(intRow, 0).Value = strLiabilitiesAndEquity Range("CommitmentsAndContingencies").Offset(intRow, 0).Value = strCommitmentsAndContingencies Range("TemporaryEquity").Offset(intRow, 0).Value = strTemporaryEquity Range("Check_BS1").Offset(intRow, 0).Value = lngBS1 Range("Check_BS2").Offset(intRow, 0).Value = lngBS2 Range("Check_BS3").Offset(intRow, 0).Value = lngBS3 Range("Check_BS4").Offset(intRow, 0).Value = lngBS4 Range("Check_BS5").Offset(intRow, 0).Value = lngBS5 Range("Check_BS1").Offset(intRow, 0).Interior.Color = IIf(lngBS1 = 0, 5296274, 65535) Range("Check_BS2").Offset(intRow, 0).Interior.Color = IIf(lngBS2 = 0, 5296274, 65535) Range("Check_BS3").Offset(intRow, 0).Interior.Color = IIf(lngBS3 = 0, 5296274, 65535) Range("Check_BS4").Offset(intRow, 0).Interior.Color = IIf(lngBS4 = 0, 5296274, 65535) Range("Check_BS5").Offset(intRow, 0).Interior.Color = IIf(lngBS5 = 0, 5296274, 65535) Exit Sub ErrorHandler: If Err.Number <> 91 Or Err.Number <> 6 Or Err.Number <> 11 Then 'Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub Private Sub GetInformation_IncomeStatement(intRow As Long) On Error GoTo ErrorHandler strRevenues = "NOT-FOUND" strCostOfRevenue = "NOT-FOUND" strGrossProfit = "NOT-FOUND" strOperatingExpenses = "NOT-FOUND" strOtherOperatingIncome = "NOT-FOUND" strOperatingIncomeLoss = "NOT-FOUND" strNonoperatingIncomeLoss = "NOT-FOUND" strIncomeLossFromContinuingOperationsBeforeTax = "NOT-FOUND" strIncomeTaxExpenseBenefit = "NOT-FOUND" strIncomeLossFromContinuingOperationsAfterTax = "NOT-FOUND" strIncomeLossFromDiscontinuedOperationsNetOfTax = "NOT-FOUND" strExtraordinaryItemsOfIncomeExpenseNetOfTax = "NOT-FOUND" strNetIncomeLoss = "NOT-FOUND" strNetIncomeLossAttributableToParent = "NOT-FOUND" strNetIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND" strNetIncomeLossAvailableToCommonStockholdersBasic = "NOT-FOUND" strPreferredStockDividendsAndOtherAdjustments = "NOT-FOUND" strOtherComprehensiveIncomeLoss = "NOT-FOUND" strComprehensiveIncomeLoss = "NOT-FOUND" strComprehensiveIncomeLossAttributableToParent = "NOT-FOUND" strComprehensiveIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND" 'Income statement 'Revenues strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:Revenues", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesRevenueNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesRevenueServicesNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesRevenueGoodsNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenuesNetOfInterestExpense", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RealEstateRevenueNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:InterestAndDividendIncomeOperating", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueMineralSales", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:OilAndGasRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:FinancialServicesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RegulatedAndUnregulatedOperatingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ShippingAndHandlingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesRevenueFromEnergyCommoditiesAndServices", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:UtilityRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:PhaseInPlanAmountOfCapitalizedCostsRecovered", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SecondaryProcessingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueSteamProductsAndServices", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueFromLeasedAndOwnedHotels", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:FranchisorRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SubscriptionRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:AdvertisingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:AdmissionsRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueFromEnrollmentAndRegistrationFeesExcludingHospitalityEnterprises", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:MembershipDuesRevenueOnGoing", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:LicensesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RoyaltyRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesOfOilAndGasProspects", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ClearingFeesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ContractsRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueFromGrants", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueOtherManufacturedProducts", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ConstructionMaterialsRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:TimberRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RecyclingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:PassengerRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SaleOfTrustAssetsToPayExpenses", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:VehicleTollRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:CargoAndFreightRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:NetInvestmentIncome", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenuesExcludingInterestAndDividends", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:InvestmentBankingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:UnderwritingIncomeLoss", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:MarketDataRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ElectricUtilityRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ReimbursementRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:LicenseAndServicesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:OilAndGasSalesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RefiningAndMarketingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:GasDomesticRegulatedRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:GoldProductsAndServicesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:NaturalGasProductionRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:InvestmentAdvisoryManagementAndAdministrativeFees", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:AssetManagementFees1", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueOilAndGasServices", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ElectricalGenerationRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:FoodAndBeverageRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueFromPurchasedOilAndGas", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:TechnologyServicesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:HomeBuildingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RetailRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ElectricalTransmissionAndDistributionRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesRevenueEnergyServices", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:OperatingLeasesIncomeStatementLeaseRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:ElectricDomesticRegulatedRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:OperatingLeasesIncomeStatementLeaseRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:InterestAndFeeIncomeLoansConsumerInstallmentAutomobilesMarineAndOtherVehicles", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:FeesAndCommissions", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:LandSales", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:GasGatheringTransportationMarketingAndProcessingRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:RevenueFromRelatedParties", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:HealthCareOrganizationRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:HealthCareOrganizationRevenueNetOfPatientServiceRevenueProvisions", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:HealthCareOrganizationPatientServiceRevenueLessProvisionForBadDebts", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:HealthCareOrganizationPatientServiceRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:OtherSalesRevenueNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:InterestIncomeExpenseNet", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:CoalProductsAndServicesRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:SalesOfRealEstate", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", GetFactValue("us-gaap:FranchiseRevenue", "Duration"), strRevenues) strRevenues = IIf(strRevenues = "NOT-FOUND", "0", strRevenues) 'CostOfRevenues strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfRevenue", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsAndServicesSold", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfServices", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSold", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSoldExcludingDepreciationDepletionAndAmortization", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSoldElectric", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:DirectOperatingCosts", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSoldOilAndGas", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSoldElectric", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:FinancialServicesCosts", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:ContractRevenueCost", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfRealEstateRevenue", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:RefiningAndMarketingCosts", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfNaturalGasPurchases", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoldProductsAndServices", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfRealEstateSales", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfMerchandiseSalesBuyingAndOccupancyCosts", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfServicesExcludingDepreciationDepletionAndAmortization", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfServicesOilAndGas", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSoldDirectMaterials", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:ExplorationExpenseMining", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:DirectCostsOfHotels", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", GetFactValue("us-gaap:TechnologyServicesCosts", "Duration"), strCostOfRevenue) strCostOfRevenue = IIf(strCostOfRevenue = "NOT-FOUND", "0", strCostOfRevenue) 'GrossProfit strGrossProfit = IIf(strGrossProfit = "NOT-FOUND", GetFactValue("us-gaap:GrossProfit", "Duration"), strGrossProfit) strGrossProfit = IIf(strGrossProfit = "NOT-FOUND", "0", strGrossProfit) 'OperatingExpenses strOperatingExpenses = IIf(strOperatingExpenses = "NOT-FOUND", GetFactValue("us-gaap:OperatingExpenses", "Duration"), strOperatingExpenses) strOperatingExpenses = IIf(strOperatingExpenses = "NOT-FOUND", GetFactValue("us-gaap:UtilitiesOperatingExpense", "Duration"), strOperatingExpenses) strOperatingExpenses = IIf(strOperatingExpenses = "NOT-FOUND", "0", strOperatingExpenses) 'OtherOperatingIncome strOtherOperatingIncome = IIf(strOtherOperatingIncome = "NOT-FOUND", GetFactValue("us-gaap:OtherOperatingIncome", "Duration"), strOtherOperatingIncome) strOtherOperatingIncome = IIf(strOtherOperatingIncome = "NOT-FOUND", "0", strOtherOperatingIncome) 'OperatingIncomeLoss strOperatingIncomeLoss = IIf(strOperatingIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:OperatingIncomeLoss", "Duration"), strOperatingIncomeLoss) strOperatingIncomeLoss = IIf(strOperatingIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperationsBeforeInterestExpenseInterestIncomeIncomeTaxesExtraordinaryItemsNoncontrollingInterestsNet", "Duration"), strOperatingIncomeLoss) strOperatingIncomeLoss = IIf(strOperatingIncomeLoss = "NOT-FOUND", "0", strOperatingIncomeLoss) ''NonoperatingIncomeLoss ' strNonoperatingIncomeLoss = IIf(strNonoperatingIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:NonoperatingIncomeExpense", "Duration"), strNonoperatingIncomeLoss) ' strNonoperatingIncomeLoss = IIf(strNonoperatingIncomeLoss = "NOT-FOUND", "0", strNonoperatingIncomeLoss) 'This is currently disabled do to an ERROR IN THE US GAAP XBRL Taxonomy: strNonoperatingIncomeLoss = "0" 'IncomeLossFromContinuingOperationsBeforeTax strIncomeLossFromContinuingOperationsBeforeTax = IIf(strIncomeLossFromContinuingOperationsBeforeTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperationsBeforeIncomeTaxesExtraordinaryItemsNoncontrollingInterest", "Duration"), strIncomeLossFromContinuingOperationsBeforeTax) strIncomeLossFromContinuingOperationsBeforeTax = IIf(strIncomeLossFromContinuingOperationsBeforeTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperationsBeforeIncomeTaxesMinorityInterestAndIncomeLossFromEquityMethodInvestments", "Duration"), strIncomeLossFromContinuingOperationsBeforeTax) strIncomeLossFromContinuingOperationsBeforeTax = IIf(strIncomeLossFromContinuingOperationsBeforeTax = "NOT-FOUND", "0", strIncomeLossFromContinuingOperationsBeforeTax) 'IncomeTaxExpenseBenefit strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", GetFactValue("us-gaap:IncomeTaxExpenseBenefit", "Duration"), strIncomeTaxExpenseBenefit) strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", GetFactValue("us-gaap:IncomeTaxExpenseBenefitContinuingOperations", "Duration"), strIncomeTaxExpenseBenefit) strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", GetFactValue("us-gaap:FederalHomeLoanBankAssessments", "Duration"), strIncomeTaxExpenseBenefit) strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", GetFactValue("us-gaap:FederalIncomeTaxExpenseBenefitContinuingOperations", "Duration"), strIncomeTaxExpenseBenefit) strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", GetFactValue("us-gaap:StateAndLocalIncomeTaxExpenseBenefitContinuingOperations", "Duration"), strIncomeTaxExpenseBenefit) strIncomeTaxExpenseBenefit = IIf(strIncomeTaxExpenseBenefit = "NOT-FOUND", "0", strIncomeTaxExpenseBenefit) 'Current and deferred detailes of income tax expense Dim strIncomeTaxExpenseBenefitCurrent As String Dim strIncomeTaxExpenseBenefitDeferred As String strIncomeTaxExpenseBenefitCurrent = "NOT-FOUND" strIncomeTaxExpenseBenefitDeferred = "NOT-FOUND" 'IncomeTaxBenefitCurrent strIncomeTaxExpenseBenefitCurrent = IIf(strIncomeTaxExpenseBenefitCurrent = "NOT-FOUND", GetFactValue("us-gaap:CurrentIncomeTaxExpenseBenefit", "Duration"), strIncomeTaxExpenseBenefitCurrent) strIncomeTaxExpenseBenefitCurrent = IIf(strIncomeTaxExpenseBenefitCurrent = "NOT-FOUND", "0", strIncomeTaxExpenseBenefitCurrent) 'IncomeTaxBenefitDeferred strIncomeTaxExpenseBenefitDeferred = IIf(strIncomeTaxExpenseBenefitDeferred = "NOT-FOUND", GetFactValue("us-gaap:DeferredIncomeTaxExpenseBenefit", "Duration"), strIncomeTaxExpenseBenefitDeferred) strIncomeTaxExpenseBenefitDeferred = IIf(strIncomeTaxExpenseBenefitDeferred = "NOT-FOUND", "0", strIncomeTaxExpenseBenefitDeferred) 'IncomeLossFromContinuingOperationsAfterTax strIncomeLossFromContinuingOperationsAfterTax = IIf(strIncomeLossFromContinuingOperationsAfterTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperationsIncludingPortionAttributableToNoncontrollingInterest", "Duration"), strIncomeLossFromContinuingOperationsAfterTax) strIncomeLossFromContinuingOperationsAfterTax = IIf(strIncomeLossFromContinuingOperationsAfterTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossBeforeExtraordinaryItemsAndCumulativeEffectOfChangeInAccountingPrinciple", "Duration"), strIncomeLossFromContinuingOperationsAfterTax) strIncomeLossFromContinuingOperationsAfterTax = IIf(strIncomeLossFromContinuingOperationsAfterTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperations", "Duration"), strIncomeLossFromContinuingOperationsAfterTax) strIncomeLossFromContinuingOperationsAfterTax = IIf(strIncomeLossFromContinuingOperationsAfterTax = "NOT-FOUND", "0", strIncomeLossFromContinuingOperationsAfterTax) 'IncomeLossFromDiscontinuedOperationsNetOfTax strIncomeLossFromDiscontinuedOperationsNetOfTax = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromDiscontinuedOperationsNetOfTax", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTax) strIncomeLossFromDiscontinuedOperationsNetOfTax = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTax = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromDiscontinuedOperationsNetOfTaxAttributableToReportingEntity", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTax) strIncomeLossFromDiscontinuedOperationsNetOfTax = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTax = "NOT-FOUND", "0", strIncomeLossFromDiscontinuedOperationsNetOfTax) 'ExtraordinaryItemsOfIncomeExpenseNetOfTax strExtraordinaryItemsOfIncomeExpenseNetOfTax = IIf(strExtraordinaryItemsOfIncomeExpenseNetOfTax = "NOT-FOUND", GetFactValue("us-gaap:ExtraordinaryItemNetOfTax", "Duration"), strExtraordinaryItemsOfIncomeExpenseNetOfTax) strExtraordinaryItemsOfIncomeExpenseNetOfTax = IIf(strExtraordinaryItemsOfIncomeExpenseNetOfTax = "NOT-FOUND", "0", strExtraordinaryItemsOfIncomeExpenseNetOfTax) 'NetIncomeLoss strNetIncomeLoss = IIf(strNetIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:ProfitLoss", "Duration"), strNetIncomeLoss) strNetIncomeLoss = IIf(strNetIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossIncludingPortionAttributableToNoncontrollingInterest", "Duration"), strNetIncomeLoss) strNetIncomeLoss = IIf(strNetIncomeLoss = "NOT-FOUND", "0", strNetIncomeLoss) 'NetIncomeLossAttributableToParent strNetIncomeLossAttributableToParent = IIf(strNetIncomeLossAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:NetIncomeLoss", "Duration"), strNetIncomeLossAttributableToParent) strNetIncomeLossAttributableToParent = IIf(strNetIncomeLossAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossAttributableToParent", "Duration"), strNetIncomeLossAttributableToParent) strNetIncomeLossAttributableToParent = IIf(strNetIncomeLossAttributableToParent = "NOT-FOUND", "0", strNetIncomeLossAttributableToParent) 'NetIncomeLossAttributableToNoncontrollingInterest strNetIncomeLossAttributableToNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:NetIncomeLossAttributableToNoncontrollingInterest", "Duration"), strNetIncomeLossAttributableToNoncontrollingInterest) strNetIncomeLossAttributableToNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossAttributableToNoncontrollingInterest", "Duration"), strNetIncomeLossAttributableToNoncontrollingInterest) strNetIncomeLossAttributableToNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:IncomeLossFromContinuingOperationsAttributableToNoncontrollingEntity", "Duration"), strNetIncomeLossAttributableToNoncontrollingInterest) strNetIncomeLossAttributableToNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", "0", strNetIncomeLossAttributableToNoncontrollingInterest) 'PreferredStockDividendsAndOtherAdjustments strPreferredStockDividendsAndOtherAdjustments = IIf(strPreferredStockDividendsAndOtherAdjustments = "NOT-FOUND", GetFactValue("us-gaap:PreferredStockDividendsAndOtherAdjustments", "Duration"), strPreferredStockDividendsAndOtherAdjustments) strPreferredStockDividendsAndOtherAdjustments = IIf(strPreferredStockDividendsAndOtherAdjustments = "NOT-FOUND", "0", strPreferredStockDividendsAndOtherAdjustments) 'NetIncomeLossAvailableToCommonStockholdersBasic strNetIncomeLossAvailableToCommonStockholdersBasic = IIf(strNetIncomeLossAvailableToCommonStockholdersBasic = "NOT-FOUND", GetFactValue("us-gaap:NetIncomeLossAvailableToCommonStockholdersBasic", "Duration"), strNetIncomeLossAvailableToCommonStockholdersBasic) strNetIncomeLossAvailableToCommonStockholdersBasic = IIf(strNetIncomeLossAvailableToCommonStockholdersBasic = "NOT-FOUND", "0", strNetIncomeLossAvailableToCommonStockholdersBasic) 'OtherComprehensiveIncomeLoss strOtherComprehensiveIncomeLoss = IIf(strOtherComprehensiveIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:OtherComprehensiveIncomeLossNetOfTax", "Duration"), strOtherComprehensiveIncomeLoss) strOtherComprehensiveIncomeLoss = IIf(strOtherComprehensiveIncomeLoss = "NOT-FOUND", "0", strOtherComprehensiveIncomeLoss) 'ComprehensiveIncomeLoss strComprehensiveIncomeLoss = IIf(strComprehensiveIncomeLoss = "NOT-FOUND", GetFactValue("us-gaap:ComprehensiveIncomeNetOfTaxIncludingPortionAttributableToNoncontrollingInterest", "Duration"), strComprehensiveIncomeLoss) strComprehensiveIncomeLoss = IIf(strComprehensiveIncomeLoss = "NOT-FOUND", "0", strComprehensiveIncomeLoss) 'ComprehensiveIncomeLossAttributableToParent strComprehensiveIncomeLossAttributableToParent = IIf(strComprehensiveIncomeLossAttributableToParent = "NOT-FOUND", GetFactValue("us-gaap:ComprehensiveIncomeNetOfTax", "Duration"), strComprehensiveIncomeLossAttributableToParent) strComprehensiveIncomeLossAttributableToParent = IIf(strComprehensiveIncomeLossAttributableToParent = "NOT-FOUND", "0", strComprehensiveIncomeLossAttributableToParent) 'ComprehensiveIncomeLossAttributableToNoncontrollingInterest strComprehensiveIncomeLossAttributableToNoncontrollingInterest = IIf(strComprehensiveIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:ComprehensiveIncomeNetOfTaxAttributableToNoncontrollingInterest", "Duration"), strComprehensiveIncomeLossAttributableToNoncontrollingInterest) strComprehensiveIncomeLossAttributableToNoncontrollingInterest = IIf(strComprehensiveIncomeLossAttributableToNoncontrollingInterest = "NOT-FOUND", "0", strComprehensiveIncomeLossAttributableToNoncontrollingInterest) 'TemporaryItems Dim strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic As String Dim strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic As String strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = "NOT-FOUND" strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = "NOT-FOUND" 'ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = IIf(strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = "NOT-FOUND", GetFactValue("us-gaap:ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic", "Duration"), strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic) strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = IIf(strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = "NOT-FOUND", GetFactValue("us-gaap:ParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic", "Duration"), strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic) strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = IIf(strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = "NOT-FOUND", "0", strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic) 'UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = IIf(strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = "NOT-FOUND", GetFactValue("us-gaap:UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic", "Duration"), strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic) strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = IIf(strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = "NOT-FOUND", GetFactValue("us-gaap:UndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic", "Duration"), strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic) strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = IIf(strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic = "NOT-FOUND", "0", strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic) Dim strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut As String Dim strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal As String Dim strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal As String Dim strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal As String strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut = "NOT-FOUND" strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal = "NOT-FOUND" strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal = "NOT-FOUND" strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal = "NOT-FOUND" 'IncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut = "NOT-FOUND", GetFactValue("us-gaap:DiscontinuedOperationIncomeLossFromDiscontinuedOperationDuringPhaseOutPeriodNetOfTax", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut) strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut = "NOT-FOUND", "0", strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut) 'IncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal = "NOT-FOUND", GetFactValue("us-gaap:DiscontinuedOperationGainLossOnDisposalOfDiscontinuedOperationNetOfTax", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal) strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal = "NOT-FOUND", "0", strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal) 'IncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal = "NOT-FOUND", GetFactValue("us-gaap:DiscontinuedOperationProvisionForLossGainOnDisposalNetOfTax", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal) strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal = "NOT-FOUND", "0", strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal) 'IncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal = "NOT-FOUND", GetFactValue("us-gaap:DiscontinuedOperationAmountOfAdjustmentToPriorPeriodGainLossOnDisposalNetOfTax", "Duration"), strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal) strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal = IIf(strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal = "NOT-FOUND", "0", strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal) Dim strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest As String Dim strNetIncomeLossAttributableToRedeemableNoncontrollingInterest As String strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = "NOT-FOUND" strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = "NOT-FOUND" 'NetIncomeLossAttributableToNonredeemableNoncontrollingInterest strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:NetIncomeLossAttributableToNonredeemableNoncontrollingInterest", "Duration"), strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest) strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:NoncontrollingInterestInNetIncomeLossPreferredUnitHoldersNonredeemable", "Duration"), strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest) strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest = "NOT-FOUND", "0", strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest) 'NetIncomeLossAttributableToRedeemableNoncontrollingInterest strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:NetIncomeLossAttributableToRedeemableNoncontrollingInterest", "Duration"), strNetIncomeLossAttributableToRedeemableNoncontrollingInterest) strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = "NOT-FOUND", GetFactValue("us-gaap:NoncontrollingInterestInNetIncomeLossOperatingPartnershipsRedeemable", "Duration"), strNetIncomeLossAttributableToRedeemableNoncontrollingInterest) strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = IIf(strNetIncomeLossAttributableToRedeemableNoncontrollingInterest = "NOT-FOUND", "0", strNetIncomeLossAttributableToRedeemableNoncontrollingInterest) Dim strCostOfRevenueGoods As String Dim strCostOfRevenueServices As String strCostOfRevenueGoods = "NOT-FOUND" strCostOfRevenueServices = "NOT-FOUND" 'CostOfRevenueGoods strCostOfRevenueGoods = IIf(strCostOfRevenueGoods = "NOT-FOUND", GetFactValue("us-gaap:CostOfGoodsSold", "Duration"), strCostOfRevenueGoods) strCostOfRevenueGoods = IIf(strCostOfRevenueGoods = "NOT-FOUND", "0", strCostOfRevenueGoods) 'CostOfRevenueServices strCostOfRevenueServices = IIf(strCostOfRevenueServices = "NOT-FOUND", GetFactValue("us-gaap:CostOfServices", "Duration"), strCostOfRevenueServices) strCostOfRevenueServices = IIf(strCostOfRevenueServices = "NOT-FOUND", "0", strCostOfRevenueServices) 'Income statement impute rules 'IS-Impute-101 If CDbl(strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic) = 0 Then strParticipatingSecuritiesDistributedAndUndistributedEarningsLossBasic = CDbl(strPreferredStockDividendsAndOtherAdjustments) + CDbl(strUndistributedEarningsLossAllocatedToParticipatingSecuritiesBasic) End If 'IS-Impute-102 If CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTax) = 0 Then strIncomeLossFromDiscontinuedOperationsNetOfTax = CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTaxDuringPhaseOut) + CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTaxGainLossOnDisposal) + CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTaxProvisionForGainLossOnDisposal) + CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTaxAdjustmentToPriorYearGainLossOnDisposal) End If 'IS-Impute-103 If CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) = 0 Then strNetIncomeLossAttributableToNoncontrollingInterest = CDbl(strNetIncomeLossAttributableToNonredeemableNoncontrollingInterest) + CDbl(strNetIncomeLossAttributableToRedeemableNoncontrollingInterest) End If 'IS-Impute-104 If CDbl(strIncomeTaxExpenseBenefit) = 0 And (CDbl(strIncomeTaxExpenseBenefitCurrent) <> 0 Or CDbl(strIncomeTaxExpenseBenefitDeferred) <> 0) Then strIncomeTaxExpenseBenefit = CDbl(strIncomeTaxExpenseBenefitCurrent) + CDbl(strIncomeTaxExpenseBenefitDeferred) End If 'IS-Impute-105 If CDbl(strNetIncomeLossAttributableToParent) = 0 And CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) <> 0 And CDbl(strPreferredStockDividendsAndOtherAdjustments) = 0 Then strNetIncomeLossAttributableToParent = CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) End If 'IS-Impute-106 If CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) = 0 And CDbl(strPreferredStockDividendsAndOtherAdjustments) = 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 Then strNetIncomeLossAvailableToCommonStockholdersBasic = CDbl(strNetIncomeLossAttributableToParent) End If 'IS-Impute-107 If CDbl(strIncomeLossFromContinuingOperationsAfterTax) = 0 And CDbl(strIncomeLossFromContinuingOperationsBeforeTax) <> 0 Then strIncomeLossFromContinuingOperationsAfterTax = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - CDbl(strIncomeTaxExpenseBenefit) End If 'IS-Impute-108 If CDbl(strIncomeLossFromContinuingOperationsAfterTax) = 0 And CDbl(strNetIncomeLoss) <> 0 And CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTax) = 0 And CDbl(strExtraordinaryItemsOfIncomeExpenseNetOfTax) = 0 Then strIncomeLossFromContinuingOperationsAfterTax = CDbl(strNetIncomeLoss) End If 'IS-Impute-109 If CDbl(strNetIncomeLoss) = 0 And CDbl(strIncomeLossFromContinuingOperationsAfterTax) <> 0 Then strNetIncomeLoss = CDbl(strIncomeLossFromContinuingOperationsAfterTax) + CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTax) + CDbl(strExtraordinaryItemsOfIncomeExpenseNetOfTax) End If 'IS-Impute-110 If CDbl(strNetIncomeLoss) = 0 And CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 Then strNetIncomeLoss = CDbl(strNetIncomeLossAttributableToParent) End If 'IS-Impute-111 If CDbl(strIncomeLossFromContinuingOperationsBeforeTax) = 0 And CDbl(strIncomeLossFromContinuingOperationsAfterTax) <> 0 And CDbl(strIncomeTaxExpenseBenefit) = 0 Then strIncomeLossFromContinuingOperationsBeforeTax = CDbl(strIncomeLossFromContinuingOperationsAfterTax) End If 'IS-Impute-112 If CDbl(strNetIncomeLoss) = 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 And CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) <> 0 Then strNetIncomeLoss = CDbl(strNetIncomeLossAttributableToParent) + CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) End If 'IS-Impute-113 If CDbl(strNetIncomeLossAttributableToParent) = 0 And CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) <> 0 And CDbl(strNetIncomeLoss) <> 0 Then strNetIncomeLossAttributableToParent = CDbl(strNetIncomeLoss) - CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) End If 'IS-Impute-114 If CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) = 0 And CDbl(strPreferredStockDividendsAndOtherAdjustments) <> 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 Then strNetIncomeLossAvailableToCommonStockholdersBasic = CDbl(strNetIncomeLossAttributableToParent) - CDbl(strPreferredStockDividendsAndOtherAdjustments) End If 'IS-Impute-115 If CDbl(strNetIncomeLossAttributableToParent) = 0 And CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strNetIncomeLoss) <> 0 Then strNetIncomeLossAttributableToParent = CDbl(strNetIncomeLoss) End If 'IS-Impute-116 If CDbl(strPreferredStockDividendsAndOtherAdjustments) = 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 And CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) <> 0 Then strPreferredStockDividendsAndOtherAdjustments = CDbl(strNetIncomeLossAttributableToParent) - CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) End If 'IS-Impute-117 If CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) = 0 And CDbl(strPreferredStockDividendsAndOtherAdjustments) = 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 Then strNetIncomeLossAvailableToCommonStockholdersBasic = CDbl(strNetIncomeLossAttributableToParent) End If 'IS-Impute-118 If CDbl(strIncomeLossFromContinuingOperationsAfterTax) = 0 And CDbl(strNetIncomeLoss) <> 0 Then strIncomeLossFromContinuingOperationsAfterTax = CDbl(strNetIncomeLoss) - CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTax) - CDbl(strExtraordinaryItemsOfIncomeExpenseNetOfTax) End If 'IS-Impute-119 If CDbl(strIncomeLossFromContinuingOperationsAfterTax) = 0 And CDbl(strIncomeTaxExpenseBenefit) <> 0 And CDbl(strIncomeLossFromContinuingOperationsBeforeTax) <> 0 Then strIncomeLossFromContinuingOperationsAfterTax = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - CDbl(strIncomeTaxExpenseBenefit) End If 'IS-Impute-120 If CDbl(strIncomeLossFromContinuingOperationsBeforeTax) = 0 And CDbl(strIncomeLossFromContinuingOperationsAfterTax) <> 0 Then strIncomeLossFromContinuingOperationsBeforeTax = CDbl(strIncomeLossFromContinuingOperationsAfterTax) + CDbl(strIncomeTaxExpenseBenefit) End If 'IS-Impute-121 If CDbl(strNonoperatingIncomeLoss) = 0 And CDbl(strIncomeLossFromContinuingOperationsBeforeTax) <> 0 And CDbl(strOperatingIncomeLoss) <> 0 Then strNonoperatingIncomeLoss = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - CDbl(strOperatingIncomeLoss) End If 'IS-Impute-122 If CDbl(strGrossProfit) = 0 And (CDbl(strRevenues) <> 0 And CDbl(strCostOfRevenue) <> 0) Then strGrossProfit = CDbl(strRevenues) - CDbl(strCostOfRevenue) End If 'IS-Impute-123 'This adds OperatingIncomeLoss <> 0 to the IF statement If CDbl(strOperatingExpenses) = 0 And CDbl(strGrossProfit) <> 0 And CDbl(strOperatingIncomeLoss) <> 0 Then strOperatingExpenses = CDbl(strGrossProfit) - CDbl(strOperatingIncomeLoss) End If 'IS-Impute-123a ADDED TO OVERCOME IMPUTING IF GROSS PROFIT IS ZERO 'This DOES NOT OperatingIncomeLoss <> 0 to the IF statement If CDbl(strOperatingExpenses) = 0 And (CDbl(strOperatingIncomeLoss) - (CDbl(strGrossProfit) - CDbl(strOperatingExpenses) + CDbl(strOtherOperatingIncome))) <> 0 Then strOperatingExpenses = CDbl(strGrossProfit) - CDbl(strOperatingIncomeLoss) End If 'IS-Impute-124 If CDbl(strCostOfRevenue) = 0 And CDbl(strGrossProfit) <> 0 And CDbl(strRevenues) <> 0 Then strCostOfRevenue = CDbl(strRevenues) - CDbl(strGrossProfit) End If 'IS-Impute-125 If CDbl(strNetIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strNetIncomeLoss) <> 0 And CDbl(strNetIncomeLossAttributableToParent) <> 0 And CDbl(strEquityAttributableToNoncontrollingInterest) <> 0 Then strNetIncomeLossAttributableToNoncontrollingInterest = CDbl(strNetIncomeLoss) - CDbl(strNetIncomeLossAttributableToParent) End If 'IS-Impute-126 If CDbl(strCostOfRevenue) = 0 And CDbl(strGrossProfit) <> (CDbl(strRevenues) - CDbl(strCostOfRevenue)) And CDbl(strGrossProfit) = (CDbl(strRevenues) - CDbl(strCostOfRevenueGoods) + CDbl(strCostOfRevenueServices)) Then strGrossProfit = CDbl(strRevenues) - CDbl(strCostOfRevenue) End If 'Not in MASTER, might need to be added 'If CDbl(strNonoperatingIncomeLoss) = 0 And CDbl(strIncomeLossFromContinuingOperationsBeforeTax) <> 0 And CDbl(strOperatingIncomeLoss) <> 0 Then ' strNonoperatingIncomeLoss = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - CDbl(strOperatingIncomeLoss) + CDbl(strOtherOperatingIncome) 'End If 'Statement of comprehensive income 'IS-Impute-201 If CDbl(strComprehensiveIncomeLossAttributableToParent) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strComprehensiveIncomeLoss) <> 0 Then strComprehensiveIncomeLossAttributableToParent = CDbl(strComprehensiveIncomeLoss) End If 'IS-Impute-202 If CDbl(strComprehensiveIncomeLossAttributableToParent) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) <> 0 And CDbl(strComprehensiveIncomeLoss) <> 0 Then strComprehensiveIncomeLossAttributableToParent = CDbl(strComprehensiveIncomeLoss) - CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) End If 'IS-Impute-203 If CDbl(strComprehensiveIncomeLoss) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) <> 0 And CDbl(strComprehensiveIncomeLossAttributableToParent) <> 0 Then strComprehensiveIncomeLoss = CDbl(strComprehensiveIncomeLossAttributableToParent) + CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) End If 'IS-Impute-204 If CDbl(strComprehensiveIncomeLoss) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strComprehensiveIncomeLossAttributableToParent) <> 0 Then strComprehensiveIncomeLoss = CDbl(strComprehensiveIncomeLossAttributableToParent) End If 'IS-Impute-205 If CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strComprehensiveIncomeLoss) <> 0 And CDbl(strComprehensiveIncomeLossAttributableToParent) <> 0 Then strComprehensiveIncomeLossAttributableToNoncontrollingInterest = CDbl(strComprehensiveIncomeLoss) - CDbl(strComprehensiveIncomeLossAttributableToParent) End If 'IS-Impute-206 If CDbl(strComprehensiveIncomeLoss) = 0 And CDbl(strComprehensiveIncomeLossAttributableToParent) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strOtherComprehensiveIncomeLoss) = 0 Then strComprehensiveIncomeLoss = CDbl(strNetIncomeLoss) End If 'IS-Impute-207 If CDbl(strOtherComprehensiveIncomeLoss) = 0 And CDbl(strComprehensiveIncomeLoss) <> 0 Then strOtherComprehensiveIncomeLoss = CDbl(strComprehensiveIncomeLoss) - CDbl(strNetIncomeLoss) End If 'IS-Impute-208 If CDbl(strComprehensiveIncomeLossAttributableToParent) = 0 And CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strComprehensiveIncomeLoss) <> 0 Then strComprehensiveIncomeLossAttributableToParent = CDbl(strComprehensiveIncomeLoss) End If 'IS-Impute-209 If CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest) = 0 And CDbl(strComprehensiveIncomeLossAttributableToParent) <> 0 And CDbl(strComprehensiveIncomeLoss) <> 0 Then strComprehensiveIncomeLossAttributableToNoncontrollingInterest = CDbl(strComprehensiveIncomeLoss) - CDbl(strComprehensiveIncomeLossAttributableToParent) End If Debug.Print "Revenues: " & strRevenues Debug.Print "CostOfRevenues: " & strCostOfRevenue Debug.Print "GrossProfit: " & strGrossProfit Debug.Print "OperatingExpenses: " & strOperatingExpenses Debug.Print "OtherOperatingIncome: " & strOtherOperatingIncome Debug.Print "OperatingIncomeLoss: " & strOperatingIncomeLoss Debug.Print "NonoperatingIncomeLoss: " & strNonoperatingIncomeLoss Debug.Print "Income (Loss) from Continuing Operations Before Tax: " & strIncomeLossFromContinuingOperationsBeforeTax Debug.Print "Income Tax Expense (Benefit): " & strIncomeTaxExpenseBenefit Debug.Print "Income (Loss) from Continuing Operations After Tax: " & strIncomeLossFromContinuingOperationsAfterTax Debug.Print "Income (Loss) from Discontinued Operations: " & strIncomeLossFromDiscontinuedOperationsNetOfTax Debug.Print "Extraordinary Items, Gain (Loss): " & strExtraordinaryItemsOfIncomeExpenseNetOfTax Debug.Print "Net Income (Loss): " & strNetIncomeLoss Debug.Print "Net Income (Loss) Attributable to Parent: " & strNetIncomeLossAttributableToParent Debug.Print "Net Income (Loss) Attributable to Noncontrolling Interest: " & strNetIncomeLossAttributableToNoncontrollingInterest Debug.Print "Preferred Stock Dividends and Other Adjustments: " & strPreferredStockDividendsAndOtherAdjustments Debug.Print "Net Income (Loss) Available to Common Stockholders, Basic: " & strNetIncomeLossAvailableToCommonStockholdersBasic Debug.Print "Other Comprehensive Income: " & strOtherComprehensiveIncomeLoss Debug.Print "Comprehensive Income: " & strComprehensiveIncomeLoss Debug.Print "Comprehensive Income Attributable to Parent: " & strComprehensiveIncomeLossAttributableToParent Debug.Print "Comprehensive Income Attributable to Noncontrolling Interest: " & strComprehensiveIncomeLossAttributableToNoncontrollingInterest Dim lngIS1 As Double Dim lngIS2 As Double Dim lngIS3 As Double Dim lngIS4 As Double Dim lngIS5 As Double Dim lngIS6 As Double Dim lngIS7 As Double Dim lngIS8 As Double Dim lngIS9 As Double Dim lngIS10 As Double ' IS2 = InterestIncomeExpenseAfterProvisionForLosses - (InterestIncomeExpenseOperatingNet - ProvisionForLoanLeaseAndOtherLosses) lngIS1 = (CDbl(strGrossProfit) - (CDbl(strRevenues) - CDbl(strCostOfRevenue))) lngIS2 = (CDbl(strOperatingIncomeLoss) - (CDbl(strGrossProfit) - CDbl(strOperatingExpenses) + CDbl(strOtherOperatingIncome))) lngIS3 = 0 lngIS4 = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - (CDbl(strOperatingIncomeLoss) + CDbl(strNonoperatingIncomeLoss)) 'lngIS5 = CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - (CDbl(strOperatingIncomeLoss) + CDbl(strNonoperatingIncomeLoss)) lngIS5 = CDbl(strIncomeLossFromContinuingOperationsAfterTax) - (CDbl(strIncomeLossFromContinuingOperationsBeforeTax) - CDbl(strIncomeTaxExpenseBenefit)) lngIS6 = CDbl(strNetIncomeLoss) - (CDbl(strIncomeLossFromContinuingOperationsAfterTax) + CDbl(strIncomeLossFromDiscontinuedOperationsNetOfTax) + CDbl(strExtraordinaryItemsOfIncomeExpenseNetOfTax)) lngIS7 = CDbl(strNetIncomeLoss) - (CDbl(strNetIncomeLossAttributableToParent) + CDbl(strNetIncomeLossAttributableToNoncontrollingInterest)) lngIS8 = CDbl(strNetIncomeLossAvailableToCommonStockholdersBasic) - (CDbl(strNetIncomeLossAttributableToParent) - CDbl(strPreferredStockDividendsAndOtherAdjustments)) lngIS9 = CDbl(strComprehensiveIncomeLoss) - (CDbl(strComprehensiveIncomeLossAttributableToParent) + CDbl(strComprehensiveIncomeLossAttributableToNoncontrollingInterest)) lngIS10 = CDbl(strComprehensiveIncomeLoss) - (CDbl(strNetIncomeLoss) + CDbl(strOtherComprehensiveIncomeLoss)) Debug.Print " " Debug.Print "IS1: GrossProfit(" & strGrossProfit & ") = Revenues(" & strRevenues & ") - CostOfRevenues(" & strCostOfRevenue & "): " & lngIS1 Debug.Print "IS2: OperatingIncomeLoss(" & strOperatingIncomeLoss & ") = GrossProfit(" & strGrossProfit & ") - OperatingExpenses(" & strOperatingExpenses & ") + OtherOperatingIncome(" & strOtherOperatingIncome & "): " & lngIS2 Debug.Print "IS3: " & lngIS3 Debug.Print "IS4: IncomeLossFromContinuingOperationsBeforeTax(" & strIncomeLossFromContinuingOperationsBeforeTax & ") = OperatingIncomeLoss(" & strOperatingIncomeLoss & ") + NonoperatingIncomeLoss(" & strNonoperatingIncomeLoss & "): " & lngIS4 Debug.Print "IS5: IncomeLossFromContinuingOperationsAfterTax(" & strIncomeLossFromContinuingOperationsAfterTax & ") = IncomeLossFromContinuingOperationsBeforeTax(" & strIncomeLossFromContinuingOperationsBeforeTax & ") - IncomeTaxExpenseBenefit(" & strIncomeTaxExpenseBenefit & "): " & lngIS5 Debug.Print "IS6: NetIncomeLoss(" & strNetIncomeLoss & ") = IncomeLossFromContinuingOperationsAfterTax(" & strIncomeLossFromContinuingOperationsAfterTax & ") + IncomeLossFromDiscontinuedOperationsNetOfTax(" & strIncomeLossFromDiscontinuedOperationsNetOfTax & ") + ExtraordinaryItemsOfIncomeExpenseNetOfTax(" & strExtraordinaryItemsOfIncomeExpenseNetOfTax & "): " & lngIS6 Debug.Print "IS7: NetIncomeLoss(" & strNetIncomeLoss & ") = NetIncomeLossAttributableToParent(" & strNetIncomeLossAttributableToParent & ") + NetIncomeLossAttributableToNoncontrollingInterest(" & strNetIncomeLossAttributableToNoncontrollingInterest & "): " & lngIS7 Debug.Print "IS8: NetIncomeLossAvailableToCommonStockholdersBasic(" & strNetIncomeLossAvailableToCommonStockholdersBasic & ") = NetIncomeLossAttributableToParent(" & strNetIncomeLossAttributableToParent & ") - PreferredStockDividendsAndOtherAdjustments(" & strPreferredStockDividendsAndOtherAdjustments & "): " & lngIS8 Debug.Print "IS9: ComprehensiveIncomeLoss(" & strComprehensiveIncomeLoss & ") = ComprehensiveIncomeLossAttributableToParent(" & strComprehensiveIncomeLossAttributableToParent & ") + ComprehensiveIncomeLossAttributableToNoncontrollingInterest(" & strComprehensiveIncomeLossAttributableToNoncontrollingInterest & "): " & lngIS9 Debug.Print "IS10: ComprehensiveIncomeLoss(" & strComprehensiveIncomeLoss & ") = NetIncomeLoss(" & strNetIncomeLoss & ") + OtherComprehensiveIncomeLoss(" & strOtherComprehensiveIncomeLoss & "): " & lngIS10 Debug.Print " " 'Populate excel 'Income Statement Range("Revenues").Offset(intRow, 0).Value = strRevenues Range("CostOfRevenues").Offset(intRow, 0).Value = strCostOfRevenue Range("GrossProfit").Offset(intRow, 0).Value = strGrossProfit Range("OperatingExpenses").Offset(intRow, 0).Value = strOperatingExpenses Range("OtherOperatingIncome").Offset(intRow, 0).Value = strOtherOperatingIncome Range("OperatingIncomeLoss").Offset(intRow, 0).Value = strOperatingIncomeLoss Range("NonoperatingIncomeLoss").Offset(intRow, 0).Value = strNonoperatingIncomeLoss Range("IncomeLossFromContinuingOperationsBeforeTax").Offset(intRow, 0).Value = strIncomeLossFromContinuingOperationsBeforeTax Range("IncomeTaxExpenseBenefit").Offset(intRow, 0).Value = strIncomeTaxExpenseBenefit Range("IncomeLossFromContinuingOperationsAfterTax").Offset(intRow, 0).Value = strIncomeLossFromContinuingOperationsAfterTax Range("IncomeLossFromDiscontinuedOperationsNetOfTax").Offset(intRow, 0).Value = strIncomeLossFromDiscontinuedOperationsNetOfTax Range("ExtraordinaryItemsOfIncomeExpenseNetOfTax").Offset(intRow, 0).Value = strExtraordinaryItemsOfIncomeExpenseNetOfTax Range("NetIncomeLoss").Offset(intRow, 0).Value = strNetIncomeLoss Range("NetIncomeLossAttributableToParent").Offset(intRow, 0).Value = strNetIncomeLossAttributableToParent Range("NetIncomeLossAttributableToNoncontrollingInterest").Offset(intRow, 0).Value = strNetIncomeLossAttributableToNoncontrollingInterest Range("PreferredStockDividendsAndOtherAdjustments").Offset(intRow, 0).Value = strPreferredStockDividendsAndOtherAdjustments Range("NetIncomeLossAvailableToCommonStockholdersBasic").Offset(intRow, 0).Value = strNetIncomeLossAvailableToCommonStockholdersBasic 'Statement of Comprehensive Income Range("NetIncomeLoss2").Offset(intRow, 0).Value = strNetIncomeLoss Range("OtherComprehensiveIncomeLoss").Offset(intRow, 0).Value = strOtherComprehensiveIncomeLoss Range("ComprehensiveIncomeLoss").Offset(intRow, 0).Value = strComprehensiveIncomeLoss Range("ComprehensiveIncomeLossAttributableToParent").Offset(intRow, 0).Value = strComprehensiveIncomeLossAttributableToParent Range("ComprehensiveIncomeLossAttributableToNoncontrollingInterest").Offset(intRow, 0).Value = strComprehensiveIncomeLossAttributableToNoncontrollingInterest Range("Check_IS1").Offset(intRow, 0).Value = lngIS1 Range("Check_IS2").Offset(intRow, 0).Value = lngIS2 Range("Check_IS3").Offset(intRow, 0).Value = lngIS3 Range("Check_IS4").Offset(intRow, 0).Value = lngIS4 Range("Check_IS5").Offset(intRow, 0).Value = lngIS5 Range("Check_IS6").Offset(intRow, 0).Value = lngIS6 Range("Check_IS7").Offset(intRow, 0).Value = lngIS7 Range("Check_IS8").Offset(intRow, 0).Value = lngIS8 Range("Check_IS9").Offset(intRow, 0).Value = lngIS9 Range("Check_IS10").Offset(intRow, 0).Value = lngIS10 Range("Check_IS1").Offset(intRow, 0).Interior.Color = IIf(lngIS1 = 0, 5296274, 65535) Range("Check_IS2").Offset(intRow, 0).Interior.Color = IIf(lngIS2 = 0, 5296274, 65535) Range("Check_IS3").Offset(intRow, 0).Interior.Color = IIf(lngIS3 = 0, 5296274, 65535) Range("Check_IS4").Offset(intRow, 0).Interior.Color = IIf(lngIS4 = 0, 5296274, 65535) Range("Check_IS5").Offset(intRow, 0).Interior.Color = IIf(lngIS5 = 0, 5296274, 65535) Range("Check_IS6").Offset(intRow, 0).Interior.Color = IIf(lngIS6 = 0, 5296274, 65535) Range("Check_IS7").Offset(intRow, 0).Interior.Color = IIf(lngIS7 = 0, 5296274, 65535) Range("Check_IS8").Offset(intRow, 0).Interior.Color = IIf(lngIS8 = 0, 5296274, 65535) Range("Check_IS9").Offset(intRow, 0).Interior.Color = IIf(lngIS9 = 0, 5296274, 65535) Range("Check_IS10").Offset(intRow, 0).Interior.Color = IIf(lngIS10 = 0, 5296274, 65535) Exit Sub ErrorHandler: If Err.Number <> 91 Or Err.Number <> 6 Or Err.Number <> 11 Then 'Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub Private Sub GetInformation_CashFlowStatement(intRow As Long) strNetCashFlow = "NOT-FOUND" strNetCashFlowsOperating = "NOT-FOUND" strNetCashFlowsInvesting = "NOT-FOUND" strNetCashFlowsFinancing = "NOT-FOUND" strNetCashFlowsOperatingContinuing = "NOT-FOUND" strNetCashFlowsInvestingContinuing = "NOT-FOUND" strNetCashFlowsFinancingContinuing = "NOT-FOUND" strNetCashFlowsOperatingDiscontinued = "NOT-FOUND" strNetCashFlowsInvestingDiscontinued = "NOT-FOUND" strNetCashFlowsFinancingDiscontinued = "NOT-FOUND" strNetCashFlowsContinuing = "NOT-FOUND" strNetCashFlowsDiscontinued = "NOT-FOUND" strExchangeGainsLosses = "NOT-FOUND" 'Cash flow statement 'NetCashFlow (ADDED FIXED ADDED FORTH concept ++++++++++++++++++++++++++++++++++++++++++++++++++ strNetCashFlow = IIf(strNetCashFlow = "NOT-FOUND", GetFactValue("us-gaap:CashAndCashEquivalentsPeriodIncreaseDecrease", "Duration"), strNetCashFlow) strNetCashFlow = IIf(strNetCashFlow = "NOT-FOUND", GetFactValue("us-gaap:CashPeriodIncreaseDecrease", "Duration"), strNetCashFlow) strNetCashFlow = IIf(strNetCashFlow = "NOT-FOUND", GetFactValue("us-gaap:CashAndCashEquivalentsPeriodIncreaseDecreaseExcludingExchangeRateEffect", "Duration"), strNetCashFlow) strNetCashFlow = IIf(strNetCashFlow = "NOT-FOUND", GetFactValue("us-gaap:CashCashEquivalentsRestrictedCashAndRestrictedCashEquivalentsPeriodIncreaseDecreaseExcludingExchangeRateEffect", "Duration"), strNetCashFlow) strNetCashFlow = IIf(strNetCashFlow = "NOT-FOUND", "0", strNetCashFlow) 'NetCashFlowsOperating strNetCashFlowsOperating = IIf(strNetCashFlowsOperating = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInOperatingActivities", "Duration"), strNetCashFlowsOperating) strNetCashFlowsOperating = IIf(strNetCashFlowsOperating = "NOT-FOUND", "0", strNetCashFlowsOperating) 'NetCashFlowsInvesting strNetCashFlowsInvesting = IIf(strNetCashFlowsInvesting = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInInvestingActivities", "Duration"), strNetCashFlowsInvesting) strNetCashFlowsInvesting = IIf(strNetCashFlowsInvesting = "NOT-FOUND", "0", strNetCashFlowsInvesting) 'NetCashFlowsFinancing strNetCashFlowsFinancing = IIf(strNetCashFlowsFinancing = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInFinancingActivities", "Duration"), strNetCashFlowsFinancing) strNetCashFlowsFinancing = IIf(strNetCashFlowsFinancing = "NOT-FOUND", "0", strNetCashFlowsFinancing) 'NetCashFlowsOperatingContinuing strNetCashFlowsOperatingContinuing = IIf(strNetCashFlowsOperatingContinuing = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInOperatingActivitiesContinuingOperations", "Duration"), strNetCashFlowsOperatingContinuing) strNetCashFlowsOperatingContinuing = IIf(strNetCashFlowsOperatingContinuing = "NOT-FOUND", "0", strNetCashFlowsOperatingContinuing) 'NetCashFlowsInvestingContinuing strNetCashFlowsInvestingContinuing = IIf(strNetCashFlowsInvestingContinuing = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInInvestingActivitiesContinuingOperations", "Duration"), strNetCashFlowsInvestingContinuing) strNetCashFlowsInvestingContinuing = IIf(strNetCashFlowsInvestingContinuing = "NOT-FOUND", "0", strNetCashFlowsInvestingContinuing) 'NetCashFlowsFinancingContinuing strNetCashFlowsFinancingContinuing = IIf(strNetCashFlowsFinancingContinuing = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInFinancingActivitiesContinuingOperations", "Duration"), strNetCashFlowsFinancingContinuing) strNetCashFlowsFinancingContinuing = IIf(strNetCashFlowsFinancingContinuing = "NOT-FOUND", "0", strNetCashFlowsFinancingContinuing) 'NetCashFlowsOperatingDiscontinued strNetCashFlowsOperatingDiscontinued = IIf(strNetCashFlowsOperatingDiscontinued = "NOT-FOUND", GetFactValue("us-gaap:CashProvidedByUsedInOperatingActivitiesDiscontinuedOperations", "Duration"), strNetCashFlowsOperatingDiscontinued) strNetCashFlowsOperatingDiscontinued = IIf(strNetCashFlowsOperatingDiscontinued = "NOT-FOUND", "0", strNetCashFlowsOperatingDiscontinued) 'NetCashFlowsInvestingDiscontinued strNetCashFlowsInvestingDiscontinued = IIf(strNetCashFlowsInvestingDiscontinued = "NOT-FOUND", GetFactValue("us-gaap:CashProvidedByUsedInInvestingActivitiesDiscontinuedOperations", "Duration"), strNetCashFlowsInvestingDiscontinued) strNetCashFlowsInvestingDiscontinued = IIf(strNetCashFlowsInvestingDiscontinued = "NOT-FOUND", "0", strNetCashFlowsInvestingDiscontinued) 'NetCashFlowsFinancingDiscontinued strNetCashFlowsFinancingDiscontinued = IIf(strNetCashFlowsFinancingDiscontinued = "NOT-FOUND", GetFactValue("us-gaap:CashProvidedByUsedInFinancingActivitiesDiscontinuedOperations", "Duration"), strNetCashFlowsFinancingDiscontinued) strNetCashFlowsFinancingDiscontinued = IIf(strNetCashFlowsFinancingDiscontinued = "NOT-FOUND", "0", strNetCashFlowsFinancingDiscontinued) 'NetCashFlowsDiscontinued strNetCashFlowsDiscontinued = IIf(strNetCashFlowsDiscontinued = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInDiscontinuedOperations", "Duration"), strNetCashFlowsDiscontinued) strNetCashFlowsDiscontinued = IIf(strNetCashFlowsDiscontinued = "NOT-FOUND", "0", strNetCashFlowsDiscontinued) 'NetCashFlowsContinuing strNetCashFlowsContinuing = IIf(strNetCashFlowsContinuing = "NOT-FOUND", GetFactValue("us-gaap:NetCashProvidedByUsedInContinuingOperations", "Duration"), strNetCashFlowsContinuing) strNetCashFlowsContinuing = IIf(strNetCashFlowsContinuing = "NOT-FOUND", "0", strNetCashFlowsContinuing) 'ExchangeGainsLosses (ADDED TWO CONCEPTS FIXED ++++++++++++++++++++++++++++++++++++++++++++++++++++++++) 'NOTE the SECOND and THIRD and FOURTH concepts are inconsistent with the master copy of FAC rules but seem to give better results; need to investigate strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCashAndCashEquivalents", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCash", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCashAndCashEquivalentsContinuingOperations", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCashCashEquivalentsRestrictedCashAndRestrictedCashEquivalents", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCashContinuingOperations", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", GetFactValue("us-gaap:EffectOfExchangeRateOnCashAndCashEquivalentsDiscontinuedOperations", "Duration"), strExchangeGainsLosses) strExchangeGainsLosses = IIf(strExchangeGainsLosses = "NOT-FOUND", "0", strExchangeGainsLosses) ' 'Cash flow statement impute rules 'CF-Impute-101 'If total net cash flow from discontinued operations IS REPORTED, but NO DETAIL is reported; then assume the net cash flow from discontinued operations is from OPERATING activities If CDbl(strNetCashFlowsOperatingDiscontinued) = 0 And CDbl(strNetCashFlowsInvestingDiscontinued) = 0 And CDbl(strNetCashFlowsFinancingDiscontinued) = 0 And CDbl(strNetCashFlowsDiscontinued) <> 0 Then strNetCashFlowsOperatingDiscontinued = CDbl(strNetCashFlowsDiscontinued) End If 'CF-Impute-102 'Impute: cash flows from continuing If CDbl(strNetCashFlowsOperatingContinuing) = 0 And CDbl(strNetCashFlowsOperating) <> 0 Then strNetCashFlowsOperatingContinuing = CDbl(strNetCashFlowsOperating) - CDbl(strNetCashFlowsOperatingDiscontinued) End If 'CF-Impute-103 If CDbl(strNetCashFlowsInvestingContinuing) = 0 And CDbl(strNetCashFlowsInvesting) <> 0 Then strNetCashFlowsInvestingContinuing = CDbl(strNetCashFlowsInvesting) - CDbl(strNetCashFlowsInvestingDiscontinued) End If 'CF-Impute-104 If CDbl(strNetCashFlowsFinancingContinuing) = 0 And CDbl(strNetCashFlowsFinancing) <> 0 Then strNetCashFlowsFinancingContinuing = CDbl(strNetCashFlowsFinancing) - CDbl(strNetCashFlowsFinancingDiscontinued) End If 'CF-Impute-105 If CDbl(strNetCashFlowsOperating) = 0 Then strNetCashFlowsOperating = CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsOperatingDiscontinued) End If 'CF-Impute-106 If CDbl(strNetCashFlowsInvesting) = 0 Then strNetCashFlowsInvesting = CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsInvestingDiscontinued) End If 'CF-Impute-107 If CDbl(strNetCashFlowsFinancing) = 0 Then strNetCashFlowsFinancing = CDbl(strNetCashFlowsFinancingContinuing) + CDbl(strNetCashFlowsFinancingDiscontinued) End If 'CF-Impute-108 If CDbl(strNetCashFlowsDiscontinued) = 0 Then strNetCashFlowsDiscontinued = CDbl(strNetCashFlowsOperatingDiscontinued) + CDbl(strNetCashFlowsInvestingDiscontinued) + CDbl(strNetCashFlowsFinancingDiscontinued) End If 'CF-Impute-109 If CDbl(strNetCashFlowsContinuing) = 0 And CDbl(strNetCashFlow) <> 0 Then strNetCashFlowsContinuing = CDbl(strNetCashFlow) - CDbl(strNetCashFlowsDiscontinued) - CDbl(strExchangeGainsLosses) End If 'CF-Impute-110 If CDbl(strNetCashFlow) = 0 And CDbl(strNetCashFlowsContinuing) <> 0 Then strNetCashFlow = CDbl(strNetCashFlowsContinuing) + CDbl(strNetCashFlowsDiscontinued) + CDbl(strExchangeGainsLosses) End If 'CF-Impute-111 If CDbl(strNetCashFlowsInvestingContinuing) = 0 And CDbl(strNetCashFlowsOperatingContinuing) <> 0 And CDbl(strNetCashFlowsFinancingContinuing) <> 0 And (CDbl(strNetCashFlowsContinuing) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsFinancingContinuing)) <> 0) Then strNetCashFlowsInvestingContinuing = CDbl(strNetCashFlowsContinuing) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsFinancingContinuing)) End If 'CF-Impute-112 If CDbl(strNetCashFlowsFinancingContinuing) = 0 And CDbl(strNetCashFlowsOperatingContinuing) <> 0 And CDbl(strNetCashFlowsInvestingContinuing) <> 0 And (CDbl(strNetCashFlowsContinuing) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsFinancingContinuing)) <> 0) Then strNetCashFlowsFinancingContinuing = CDbl(strNetCashFlowsContinuing) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsInvestingContinuing)) End If 'CF-Impute-113 If CDbl(strNetCashFlowsInvesting) = 0 And CDbl(strNetCashFlowsOperating) <> 0 And CDbl(strNetCashFlowsFinancing) <> 0 And (CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsInvesting) + CDbl(strNetCashFlowsFinancing) + CDbl(strExchangeGainsLosses)) <> 0) Then strNetCashFlowsInvesting = CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsFinancing) + CDbl(strExchangeGainsLosses)) End If 'CF-Impute-114 If CDbl(strNetCashFlowsFinancing) = 0 And CDbl(strNetCashFlowsOperating) <> 0 And CDbl(strNetCashFlowsInvesting) <> 0 And (CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsInvesting) + CDbl(strNetCashFlowsFinancing) + CDbl(strExchangeGainsLosses)) <> 0) Then strNetCashFlowsFinancing = CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsInvesting) + CDbl(strExchangeGainsLosses)) End If 'CF-Impute-115 If CDbl(strNetCashFlowsContinuing) = 0 Then strNetCashFlowsContinuing = CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsFinancingContinuing) End If 'CF-Impute-116 If CDbl(strNetCashFlowsOperating) = 0 And CDbl(strNetCashFlowsOperatingContinuing) <> 0 And CDbl(strNetCashFlowsOperatingDiscontinued) = 0 Then strNetCashFlowsOperating = CDbl(strNetCashFlowsOperatingContinuing) End If 'CF-Impute-117 If CDbl(strNetCashFlowsInvesting) = 0 And CDbl(strNetCashFlowsInvestingContinuing) <> 0 And CDbl(strNetCashFlowsInvestingDiscontinued) = 0 Then strNetCashFlowsInvesting = CDbl(strNetCashFlowsInvestingContinuing) End If 'CF-Impute-118 If CDbl(strNetCashFlowsFinancing) = 0 And CDbl(strNetCashFlowsFinancingContinuing) <> 0 And CDbl(strNetCashFlowsFinancingDiscontinued) = 0 Then strNetCashFlowsFinancing = CDbl(strNetCashFlowsFinancingContinuing) End If 'CF-Impute-119 If CDbl(strNetCashFlowsInvestingContinuing) = 0 And CDbl(strNetCashFlowsInvestingDiscontinued) = 0 And CDbl(strNetCashFlowsInvesting) <> 0 Then strNetCashFlowsInvestingContinuing = CDbl(strNetCashFlowsInvesting) End If 'CF-Impute-120 If CDbl(strNetCashFlowsFinancingContinuing) = 0 And CDbl(strNetCashFlowsFinancingDiscontinued) = 0 And CDbl(strNetCashFlowsFinancing) <> 0 Then strNetCashFlowsFinancingContinuing = CDbl(strNetCashFlowsFinancing) End If 'CF-Impute-121 If CDbl(strNetCashFlow) = 0 And CDbl(strNetCashFlowsContinuing) <> 0 And CDbl(strNetCashFlowsDiscontinued) = 0 And CDbl(strNetCashFlowsOperatingDiscontinued) = 0 And CDbl(strNetCashFlowsInvestingDiscontinued) = 0 And CDbl(strNetCashFlowsFinancingDiscontinued) = 0 And CDbl(strExchangeGainsLosses) = 0 Then strNetCashFlow = CDbl(strNetCashFlowsContinuing) End If 'CF-Impute-122 If CDbl(strNetCashFlow) = 0 And CDbl(strNetCashFlowsOperating) <> 0 And CDbl(strNetCashFlowsInvesting) <> 0 And CDbl(strNetCashFlowsFinancing) <> 0 Then strNetCashFlow = CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsInvesting) + CDbl(strNetCashFlowsFinancing) + CDbl(strExchangeGainsLosses) End If 'CF-Impute-123 If CDbl(strNetCashFlow) = 0 And CDbl(strNetCashFlowsContinuing) <> 0 And CDbl(strNetCashFlowsDiscontinued) <> 0 Then strNetCashFlow = CDbl(strNetCashFlowsContinuing) + CDbl(strNetCashFlowsDiscontinued) + CDbl(strExchangeGainsLosses) End If Debug.Print "Net Cash Flow: " & strNetCashFlow Debug.Print "Net Cash Flow, Operating: " & strNetCashFlowsOperating Debug.Print "Net Cash Flow, Investing: " & strNetCashFlowsInvesting Debug.Print "Net Cash Flow, Financing: " & strNetCashFlowsFinancing Debug.Print "Net Cash Flow, Operating, Continuing: " & strNetCashFlowsOperatingContinuing Debug.Print "Net Cash Flow, Investing, Continuing: " & strNetCashFlowsInvestingContinuing Debug.Print "Net Cash Flow, Financing, Continuing: " & strNetCashFlowsFinancingContinuing Debug.Print "Net Cash Flow, Operating, Discontinued: " & strNetCashFlowsOperatingDiscontinued Debug.Print "Net Cash Flow, Investing, Discontinued: " & strNetCashFlowsInvestingDiscontinued Debug.Print "Net Cash Flow, Financing, Discontinued: " & strNetCashFlowsFinancingDiscontinued Debug.Print "Net Cash Flow, Continuing: " & strNetCashFlowsContinuing Debug.Print "Net Cash Flow, Discontinued: " & strNetCashFlowsDiscontinued Debug.Print "Exchange Gains (Losses): " & strExchangeGainsLosses Dim lngCF1 As Double Dim lngCF2 As Double Dim lngCF3 As Double Dim lngCF4 As Double Dim lngCF5 As Double Dim lngCF6 As Double 'MsgBox strNetCashFlowsOperatingContinuing 'MsgBox strNetCashFlowsInvestingContinuing 'MsgBox strNetCashFlowsFinancingContinuing 'MsgBox strExchangeGainsLosses 'MsgBox strNetCashFlow lngCF1 = CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsOperating) + CDbl(strNetCashFlowsInvesting) + CDbl(strNetCashFlowsFinancing) + CDbl(strExchangeGainsLosses)) 'lngCF2 = CDbl(strNetCashFlowsContinuing) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsFinancingContinuing)) lngCF2 = CDbl(strNetCashFlow) - (CDbl(strNetCashFlowsContinuing) + CDbl(strNetCashFlowsDiscontinued) + CDbl(strExchangeGainsLosses)) lngCF3 = CDbl(strNetCashFlowsDiscontinued) - (CDbl(strNetCashFlowsOperatingDiscontinued) + CDbl(strNetCashFlowsInvestingDiscontinued) + CDbl(strNetCashFlowsFinancingDiscontinued)) lngCF4 = CDbl(strNetCashFlowsOperating) - (CDbl(strNetCashFlowsOperatingContinuing) + CDbl(strNetCashFlowsOperatingDiscontinued)) lngCF5 = CDbl(strNetCashFlowsInvesting) - (CDbl(strNetCashFlowsInvestingContinuing) + CDbl(strNetCashFlowsInvestingDiscontinued)) lngCF6 = CDbl(strNetCashFlowsFinancing) - (CDbl(strNetCashFlowsFinancingContinuing) + CDbl(strNetCashFlowsFinancingDiscontinued)) Debug.Print " " Debug.Print "CF1: NetCashFlow(" & strNetCashFlow & ") = (NetCashFlowsOperating(" & strNetCashFlowsOperating & ") + (NetCashFlowsInvesting(" & strNetCashFlowsInvesting & ") + (NetCashFlowsFinancing(" & strNetCashFlowsFinancing & ") + ExchangeGainsLosses(" & strExchangeGainsLosses & "): " & lngCF1 Debug.Print "CF2: NetCashFlowsContinuing(" & strNetCashFlowsContinuing & ") = NetCashFlowsOperatingContinuing(" & strNetCashFlowsOperatingContinuing & ") + NetCashFlowsInvestingContinuing(" & strNetCashFlowsInvestingContinuing & ") + NetCashFlowsFinancingContinuing(" & strNetCashFlowsFinancingContinuing & "): " & lngCF2 Debug.Print "CF3: NetCashFlowsDiscontinued(" & strNetCashFlowsDiscontinued & ") = NetCashFlowsOperatingDiscontinued(" & strNetCashFlowsOperatingDiscontinued & ") + NetCashFlowsInvestingDiscontinued(" & strNetCashFlowsInvestingDiscontinued & ") + NetCashFlowsFinancingDiscontinued(" & strNetCashFlowsFinancingDiscontinued & "): " & lngCF3 Debug.Print "CF4: NetCashFlowsOperating(" & strNetCashFlowsOperating & ") = NetCashFlowsOperatingContinuing(" & strNetCashFlowsOperatingContinuing & ") + NetCashFlowsOperatingDiscontinued(" & strNetCashFlowsOperatingDiscontinued & "): " & lngCF4 Debug.Print "CF5: NetCashFlowsInvesting(" & strNetCashFlowsInvesting & ") = NetCashFlowsInvestingContinuing(" & strNetCashFlowsInvestingContinuing & ") + NetCashFlowsInvestingDiscontinued(" & strNetCashFlowsInvestingDiscontinued & "): " & lngCF5 Debug.Print "CF6: NetCashFlowsFinancing(" & strNetCashFlowsFinancing & ") = NetCashFlowsFinancingContinuing(" & strNetCashFlowsFinancingContinuing & ") + NetCashFlowsFinancingDiscontinued(" & strNetCashFlowsFinancingDiscontinued & "): " & lngCF6 'Populate excel 'Cash flow statement Range("NetCashFlowsOperatingContinuing").Offset(intRow, 0).Value = strNetCashFlowsOperatingContinuing Range("NetCashFlowsOperatingDiscontinued").Offset(intRow, 0).Value = strNetCashFlowsOperatingDiscontinued Range("NetCashFlowsOperating").Offset(intRow, 0).Value = strNetCashFlowsOperating Range("NetCashFlowsInvestingContinuing").Offset(intRow, 0).Value = strNetCashFlowsInvestingContinuing Range("NetCashFlowsInvestingDiscontinued").Offset(intRow, 0).Value = strNetCashFlowsInvestingDiscontinued Range("NetCashFlowsInvesting").Offset(intRow, 0).Value = strNetCashFlowsInvesting Range("NetCashFlowsFinancingContinuing").Offset(intRow, 0).Value = strNetCashFlowsFinancingContinuing Range("NetCashFlowsFinancingDiscontinued").Offset(intRow, 0).Value = strNetCashFlowsFinancingDiscontinued Range("NetCashFlowsFinancing").Offset(intRow, 0).Value = strNetCashFlowsFinancing Range("NetCashFlowsContinuing").Offset(intRow, 0).Value = strNetCashFlowsContinuing Range("NetCashFlowsDiscontinued").Offset(intRow, 0).Value = strNetCashFlowsDiscontinued Range("ExchangeGainsLosses").Offset(intRow, 0).Value = strExchangeGainsLosses Range("NetCashFlow").Offset(intRow, 0).Value = strNetCashFlow Range("Check_CF1").Offset(intRow, 0).Value = lngCF1 Range("Check_CF2").Offset(intRow, 0).Value = lngCF2 Range("Check_CF3").Offset(intRow, 0).Value = lngCF3 Range("Check_CF4").Offset(intRow, 0).Value = lngCF4 Range("Check_CF5").Offset(intRow, 0).Value = lngCF5 Range("Check_CF6").Offset(intRow, 0).Value = lngCF6 Range("Check_CF1").Offset(intRow, 0).Interior.Color = IIf(lngCF1 = 0, 5296274, 65535) Range("Check_CF2").Offset(intRow, 0).Interior.Color = IIf(lngCF2 = 0, 5296274, 65535) Range("Check_CF3").Offset(intRow, 0).Interior.Color = IIf(lngCF3 = 0, 5296274, 65535) Range("Check_CF4").Offset(intRow, 0).Interior.Color = IIf(lngCF4 = 0, 5296274, 65535) Range("Check_CF5").Offset(intRow, 0).Interior.Color = IIf(lngCF5 = 0, 5296274, 65535) Range("Check_CF6").Offset(intRow, 0).Interior.Color = IIf(lngCF6 = 0, 5296274, 65535) Exit Sub ErrorHandler: If Err.Number <> 91 Or Err.Number <> 6 Or Err.Number <> 11 Then 'Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub Private Sub GetInformation_KeyRatios(intRow As Long) On Error GoTo ErrorHandler 'Key ratios Dim strSGR As String Dim strROA As String Dim strROE As String Dim strROS As String strSGR = "0" strROA = "0" strROE = "0" strROS = "0" strSGR = ((CDbl(strNetIncomeLoss) / CDbl(strRevenues)) * (1 + ((CDbl(strAssets) - CDbl(strEquity)) / CDbl(strEquity)))) / ((1 / (CDbl(strRevenues) / CDbl(strAssets))) - (((CDbl(strNetIncomeLoss) / CDbl(strRevenues)) * (1 + (((CDbl(strAssets) - CDbl(strEquity)) / CDbl(strEquity))))))) strROA = CDbl(strNetIncomeLoss) / CDbl(strAssets) strROE = CDbl(strNetIncomeLoss) / CDbl(strEquity) strROS = CDbl(strNetIncomeLoss) / CDbl(strRevenues) Range("SustainableGrowthRate").Offset(intRow, 0).Value = strSGR Range("ReturnOnAssets").Offset(intRow, 0).Value = strROA Range("ReturnOnEquity").Offset(intRow, 0).Value = strROE Range("ReturnOnSales").Offset(intRow, 0).Value = strROS Debug.Print " " Debug.Print "SGR:" & Format(CDbl(strSGR), "0.0##") Debug.Print "ROA:" & Format(CDbl(strROA), "0.0##") Debug.Print "ROE:" & Format(CDbl(strROE), "0.0##") Debug.Print "ROS:" & Format(CDbl(strROS), "0.0##") Exit Sub ErrorHandler: If Err.Number <> 91 Or Err.Number <> 6 Or Err.Number <> 11 Then 'Debug.Print "Error number " & Err.Number & ": " & Err.Description Resume Next End If End Sub