Puertorekinsam
Active Member
- Joined
- Oct 8, 2005
- Messages
- 293
I have a userform that during run time creates 256 individual labels (they represent 5 charts with 53 weeks of data).
This works great, I move the axis and scale as needed, I color code them based upon data in the spreadsheets, they have control tips to show their full value.s
I also have them all exist as a part of a class this way, when one is clicked, all five charts highlight the same "week" and load some information into group of labels to give full context of the selected week.
Again, this part works great.
What I can't figure out is how to pragmatically call the label click for the last generated label. This way the form is fully filled out when it initially shows up.
If the labels existed before the form is generated, I would easily just have
But if I put that code in, I am told "Sub or function not defined". Which totally makes sense
I saw something about using the CallByName but I'm not sure how to use that with a class item:
I have this code after two for loops,
one runs through the 5 metrics displayed in the charts... the last one giving the variable "MetName" the value of "REV"
The second loops through the 52 bars on the chart (0-52) and loads that into the variable i
In callByName, I have tried: "ME", "LongTermTrends" (the name of the userform), "Class3", "LongTermCharts" (the name of the object in the class that has events)
Here are all the versions I've tried that don't seem to work (with full names writen out)
Thanks for the help!
This works great, I move the axis and scale as needed, I color code them based upon data in the spreadsheets, they have control tips to show their full value.s
I also have them all exist as a part of a class this way, when one is clicked, all five charts highlight the same "week" and load some information into group of labels to give full context of the selected week.
Again, this part works great.
What I can't figure out is how to pragmatically call the label click for the last generated label. This way the form is fully filled out when it initially shows up.
If the labels existed before the form is generated, I would easily just have
Code:
call Rev52_Click
But if I put that code in, I am told "Sub or function not defined". Which totally makes sense
I saw something about using the CallByName but I'm not sure how to use that with a class item:
I have this code after two for loops,
one runs through the 5 metrics displayed in the charts... the last one giving the variable "MetName" the value of "REV"
The second loops through the 52 bars on the chart (0-52) and loads that into the variable i
Code:
strName = MetName & (i - 1) & "_Click"
CallByName Me, strName, VbMethod
In callByName, I have tried: "ME", "LongTermTrends" (the name of the userform), "Class3", "LongTermCharts" (the name of the object in the class that has events)
Here are all the versions I've tried that don't seem to work (with full names writen out)
Code:
CallByName Me, "Rev52_Click", VbMethod
CallByName LongTermTrends, "Rev52_Click", VbMethod
CallByName Class3, "Rev52_Click", VbMethod
CallByName LongTermCharts, "Rev52_Click", VbMethod
CallByName Class3, "LongTermCharts_Click", VbMethod
Thanks for the help!