The problem I'm having is in column A on one of my worksheets (Tails) there is a formula array (Below) that basically pulls and lists all data that is considered a 'Tail' from another worksheet (Circuits)

`{=IFERROR(IF(INDEX(Circuits!$B:$B,SMALL(IF("Tail"=Circuits!$A:$A,ROW(Circuits!$A:$A)),ROW(M1)))=0,"",INDEX(Circuits!$B:$B,SMALL(IF("Tail"=Circuits!$A:$A,ROW(Circuits!$A:$A)),ROW(M1)))),"")}`

This function does work but takes a while due to the number of lines in the array (2000) and the rest of the table uses VLOOKUP to pull data based on the ID that the formula array lists so the worksheet looks something like this:

```
+--------------+---------+---------+-----------+
| ID | Age | Status | Fail Date |
+--------------+---------+---------+-----------+
| ArrayFormula | Vlookup | Vlookup | Vlookup |
| ArrayFormula | Vlookup | Vlookup | Vlookup |
+--------------+---------+---------+-----------+
```

Problem is because there can be a max of 2000 rows in the array formula (So 22000 VLOOKUPS) I have disabled calculation on that worksheet and put a button in place for users to press if/when they need to calculate the tails. This allows them to use the rest of the workbook without excel trying to calculate every second.

**This is where the problem comes in**

The code that I wrote to basically force excel to complete calculation before proceeding with the formatting just doesn't work.

VBA Code:

```
Sub Tails_Tracker_Setup()
Dim myMB As Integer
myMB = MsgBox("Tails calculation is CPU/RAM intensive and could take several minutes based on number of circuits (Limited to Max 2000) Do you want to proceed?", vbYesNo + vbQuestion, "Calculate Tails")
If Answer = vbYes Then
Call Tails_Enable_Calc
Application.Calculate
If Not Application.CalculationState = xlDone Then
DoEvents
End If
Call Tails_Hide_Actual
Call Tails_Hide_10DD
Call Tails_Disable_Calc
Else
GoTo NoCalc
End If
NoCalc:
End Sub
```

So in order to understand I will explain what each call function does.

Call Tails_Enable_Calc - Enables calculation on the 'tails' sheet

Call Tails_Hide_Actual - Hides rows 5-2004 where the formula array has a value of ""

Call Tails_Hide_10DD - Hides rows 2007-2506 where a slightly different formula array has a value of ""

Call Tails_Disable_Calc - Disables calculation on the 'tails' sheet

What I'm finding is it doesn't actually calculate the array formula and spends 20-30 minutes doing god knows what before just hiding all the lines (Because the array formula hasn't updated so will return "")

I did do some googline but nothing has helped this even changing the If code to below:

VBA Code:

```
If Application.CalculationState = xlDone Then
DoEvents
End If
'I even tried:'
Do Until Application.CalculationState = xlDone: DoEvents: Loop
```

If I manually enable calculation then it does update the array and vlookups, however it won't hide the blank rows and slows down the rest of the workbook which removes the point of automation.

Any help or guidance in the right direction will be greatly appreciated,

Thanks in advance