Function SPARKBARS(range as Variant) If IsArray(range) Then max = range(LBound(range, 1), LBound(range, 2)) For i = LBound(range, 1) to UBound(range, 1) For j = LBound(range, 2) to UBound(range, 2) v = range(i, j) If (v > max) Then max = v End If Next j Next i SPARKBARS = "" For i = LBound(range, 1) to UBound(range, 1) For j = LBound(range, 2) to UBound(range, 2) v = range(i, j) ix = Int(v * 99 / max) SPARKBARS = SPARKBARS & chr(clng("&HE000") + ix) Next j Next i Else SPARKBARS = "#RANGE?" End If End Function Function SPARKLINES(range as Variant) If IsArray(range) Then max = range(LBound(range, 1), LBound(range, 2)) For i = LBound(range, 1) to UBound(range, 1) For j = LBound(range, 2) to UBound(range, 2) v = range(i, j) If (v > max) Then max = v End If Next j Next i SPARKLINES = "" start_i = LBound(range, 1) start_j = LBound(range, 2) last_val = range(start_i, start_j) last_ix = Int(last_val * 49 / max) For i = LBound(range, 1) to UBound(range, 1) For j = LBound(range, 2) to UBound(range, 2) If (i <> start_i Or j <> start_j) Then v = range(i, j) ix = Int(v * 49 / max) ch = chr(clng("&HE100") + last_ix * 50 + ix) SPARKLINES = SPARKLINES & ch last_ix = ix End If Next j Next i Else SPARKLINES = "#RANGE?" End If End Function