CB.EnumCorrelation Example 2

This example uses asm1Address to represent Assum1, uses asm2Address to represent Assum2, uses corrValue to represent Value, and then uses a loop to stop execution when all correlated assumptions have been located.

As it runs, it produces a list of the first and second asssumption in each pair of correlated assumptions, followed by the correlation value for that pair.

Sub EnumCorr2() 
   CB.CheckData

   Dim asm1Address As String
   Dim asm2Address As String
   Dim corrValue As Variant
   Dim count As Variant
   Dim initialCount As Variant

   initialCount = CB.EnumCorrelation(asm1Address, asm2Address, corrValue)
   count = initialCount
   While (count > 0)
      Cells(initialCount - count + 1, 5) = asm1Address
      Cells(initialCount - count + 1, 6) = asm2Address
      Cells(initialCount - count + 1, 7) = corrValue
      count = CB.EnumCorrelation(asm1Address, asm2Address, corrValue)
   Wend
End Sub