How to loop through Two arrays in TWO FOR Each loop <p>There are two FOR EACH loops in the code below. The first FOR loop cycles through the first array (shape 1,shape 2 ,shape 3).The second FOR loop cycles through the second array (0.3, 0.4, 0.5).</p> <p>Shape 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.3<br> Shape 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.4<br> Shape 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.5</p> <p>The second FOR loop colors the shape on my worksheet based on the value of second array. The problem is all of my shapes are being colored with first value (i.e 0.3). I want Shape 1 to be colored based on 0.3 , Shape 2 based on 0.4 and so on. Thanks for helping me with this.</p> <pre><code>Private Sub Worksheet_Calculate() Dim arr1 Dim arr2 Set arr1 = Worksheets("Sheet2").Range("valueforarr1") Set arr2 = Worksheets("Sheet2").Range("Valueforarr2") Dim c, d As Range For Each c In arr1 c = Replace(c, " ", "_") MsgBox c For Each d In arr2 If d &gt;= 0.2 And d &lt;= 0.3 Then Worksheets("Sheet1").Shapes(c).Fill.ForeColor.RGB = RGB(237, 247, 249) Exit For ElseIf d &gt; 0.3 And d &lt;= 0.4 Then Worksheets("Sheet1").Shapes(c).Fill.ForeColor.RGB = RGB(218, 238, 243) Exit For ElseIf d &gt; 0.4 And d &lt;= 0.5 Then Worksheets("Sheet1").Shapes(c).Fill.ForeColor.RGB = RGB(183, 222, 232) Exit For ElseIf d &gt; 0.5 Then Worksheets("Sheet1").Shapes(c).Fill.ForeColor.RGB = RGB(146, 205, 220) Exit For ElseIf d Is Nothing Then Worksheets("Sheet1").Shapes(c).Fill.ForeColor.RGB = RGB(255, 255, 255) Exit For End If Next d Next c End Sub </code></pre>