热相关矩阵VBA

时间:2018-01-03 15:22:08

标签: vba matrix

我已经创建了一个函数来返回数据集的矩阵相关性,但我希望这个矩阵的颜色类似于你可以使用R o Python进行的颜色

enter image description here

Function MCORRELATION(Rango As Range) As Variant
 Dim x As Variant, y As Variant, s As Integer, T As Integer, C() As Variant
 ReDim C(Rango.Columns.Count, Rango.Columns.Count)
 For i = 1 To Rango.Columns.Count Step 1
  For j = 1 To i Step 1
  C(i, j) = Application.Correl(Application.Index(Rango, , i), 
   Application.Index(Rango, , j))
 Next j
Next i
 MCORRELATION = C
End Function

如何使用VBA 条件格式化实现

0 个答案:

没有答案