• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Heat Map error

MrsLisa

New Member
Hello everyone. I'm wondering if someone could help me understand why I'm getting an error when I hit the paint map button. I'm sure all objects are labeled correctly so I can't figure it out. Thanks in advance for looking it over.
 

Attachments

  • Data-Table2.xlsm
    200.4 KB · Views: 15
Please see revised code below

Code:
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(255, 255, 255)
      .ShapeRange.Fill.Transparency = 0.3
      .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
 
Back
Top