TVP

# 小统手把手教你从0开始创建数据热力地图！

Sub 图例填色()

R1 = Cells(26, 4).Interior.Color Mod 256

G1 = Cells(26, 4).Interior.Color / 256 Mod 256

B1 = Cells(26, 4).Interior.Color / 256 / 256 Mod 256

R2 = Cells(31, 4).Interior.Color Mod 256

G2 = Cells(31, 4).Interior.Color / 256 Mod 256

B2 = Cells(31, 4).Interior.Color / 256 / 256 Mod 256

Cells(26, 5) = R1

Cells(26, 6) = G1

Cells(26, 7) = B1

Cells(31, 5) = R2

Cells(31, 6) = G2

Cells(31, 7) = B2

For i = 27 To 30

For j = 5 To 7

If Cells(26, j) > Cells(31, j) Then

Cells(i, j) = Cells(26, j) - (Cells(26, j) - Cells(31, j)) / (Cells(24, 2) - 1) * (i - 26)

Else

Cells(i, j) = Cells(31, j) - (Cells(31, j) - Cells(26, j)) / (Cells(24, 2) - 1) * (31 - i)

End If

Next

Cells(i, 4).Interior.Color = RGB(Cells(i, 5), Cells(i, 6), Cells(i, 7))

Next

End Sub

Sub 图形填色()

For i = 2 To 19

ActiveSheet.Shapes(Range("A" & i).Value).Fill.ForeColor.RGB = Range(Range("C" & i).Value).Interior.Color

Next

End Sub

Sub 设置高度()

For i = 2 To 19

ActiveSheet.Shapes(Range("A" & i).Value).Select

With Selection.ShapeRange.ThreeD

.Depth = Range("E" & i).Value

.Z = Range("E" & i).Value

.ExtrusionColor.ObjectThemeColor = msoThemeColorBackground1

End With

Next

End Sub

• 发表于:
• 原文链接https://kuaibao.qq.com/s/20181010G0C98500?refer=cp_1026
• 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号（企鹅号）传播渠道之一，根据《腾讯内容开放平台服务协议》转载发布内容。
• 如有侵权，请联系 cloudcommunity@tencent.com 删除。

2023-03-28

2023-03-28

2018-08-22

2023-03-28

2023-03-28

10元无门槛代金券