Hello
What I have is a list of data on a sheet. Through some code, I would like to visualize my data in a certain way. What I currently have is a grid, each square corresponding to a single data point. I would like to assign a tooltip to a label that will be sitting on top each of these squares.
What I have so far:
I have a userform which will be populated by labels programmatically. I am doing it like this because there are at least a few thousand labels to be created. I am currently doing it like this:
Essentially, what I have is a grid, and I would like to change the letter "x" in the label to another color when the mouse is hovering over the label.
Is this the correct way of achieving what I want, or is there a better way? Is there a way of assigning a single mouseover/hover event to the label once it has been created? (All these labels can be handled by a single function to just change the text color). How do I do that?
Thanks!
What I have is a list of data on a sheet. Through some code, I would like to visualize my data in a certain way. What I currently have is a grid, each square corresponding to a single data point. I would like to assign a tooltip to a label that will be sitting on top each of these squares.
What I have so far:
I have a userform which will be populated by labels programmatically. I am doing it like this because there are at least a few thousand labels to be created. I am currently doing it like this:
Code:
counter = 15
For i = 1 To 20
For j = 1 To numrows
Set thelabel = OwnChart.Controls.Add("Forms.Label.1", "x", True)
With thelabel
.Caption = "x"
.Top = 29 + 10.3 * (j - 1)
.Left = 20 + 10 * (i - 1)
.width = 10
.height = 10
.BackStyle = 0
.ForeColor = RGB(255, 255, 0)
.ControlTipText = ActiveSheet.Range("A" & counter).Value
End With
counter = counter + 1
Next
Next
Essentially, what I have is a grid, and I would like to change the letter "x" in the label to another color when the mouse is hovering over the label.
Is this the correct way of achieving what I want, or is there a better way? Is there a way of assigning a single mouseover/hover event to the label once it has been created? (All these labels can be handled by a single function to just change the text color). How do I do that?
Thanks!