 <p>You do not need globals for this. A simpler version might be something like:</p> <pre><code>Function mkArray() Const COLR_GREEN As Long = 11 Const COLR_RED As Long = 2 Dim areaArr As Variant, i As Long areaArr = ActiveSheet.Range("I1:J16").Value For i = 1 To UBound(areaArr, 1) Debug.Print areaArr(i, 1), areaArr(i, 2) Sheets("Sheet1").Shapes(areaArr(i, 1)).Fill.ForeColor.SchemeColor = _ IIf(areaArr(i, 2) &gt; 500, COLR_GREEN, COLR_RED) Next i End Function </code></pre> <p>If you really want to split into separate subs then you should use parameters in place of globals:</p> <p>E.g.</p> <pre><code>Function mkArray() Dim areaArr As Variant, i As Long areaArr = ActiveSheet.Range("I1:J16").Value For i = 1 To UBound(areaArr, 1) ColorShape Cstr(areaArr(i, 1)), areaArr(i, 2) Next i End Function Sub ColorShape(shpName as string, shpVal) Const COLR_GREEN As Long = 11 Const COLR_RED As Long = 2 Sheets("Sheet1").Shapes(shpName).Fill.ForeColor.SchemeColor = _ IIf(shpVal &gt; 500, COLR_GREEN, COLR_RED) End Sub </code></pre>