So I have a Geographic Heat Map with Textboxes for all 50 states and 1 for DC. I need to see about adding to the following code to make the Textbox backcolor/fillcolor equal the state color.
Sub Paint()
Dim i As Integer
For i = 1 To 50
'First, paint the state shapes
Range("actorder").Value = i
ActiveSheet.Shapes(Range("actstate").Value).Fill.ForeColor.RGB = _
Range(Range("actcolorcode").Value).Interior.Color
ActiveSheet.Shapes(Range("acttext").Value).Select
With Selection
'Second, update the text boxes
.Text = Range("acttextvalue").Value
'(Optional) Format the text boxes
.ShapeRange.Fill.ForeColor.RGB = RGB(0, 0, 0)
.ShapeRange.Fill.Transparency = 1
.ShapeRange.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)
.ShapeRange.TextFrame2.TextRange.Font.Shadow.Visible = False
.ShapeRange.TextFrame2.MarginLeft = 2.5
.ShapeRange.TextFrame2.MarginRight = 2.5
End With
Next i
End Sub
Any help is greatly appreciated. If you want a copy of the original file please let me know.
Sub Paint()
Dim i As Integer
For i = 1 To 50
'First, paint the state shapes
Range("actorder").Value = i
ActiveSheet.Shapes(Range("actstate").Value).Fill.ForeColor.RGB = _
Range(Range("actcolorcode").Value).Interior.Color
ActiveSheet.Shapes(Range("acttext").Value).Select
With Selection
'Second, update the text boxes
.Text = Range("acttextvalue").Value
'(Optional) Format the text boxes
.ShapeRange.Fill.ForeColor.RGB = RGB(0, 0, 0)
.ShapeRange.Fill.Transparency = 1
.ShapeRange.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)
.ShapeRange.TextFrame2.TextRange.Font.Shadow.Visible = False
.ShapeRange.TextFrame2.MarginLeft = 2.5
.ShapeRange.TextFrame2.MarginRight = 2.5
End With
Next i
End Sub
Any help is greatly appreciated. If you want a copy of the original file please let me know.