J
joshuafandango
Hi guys,
This is driving me insane!!!
I'm trying to have the text of all of the controltiptext properties on
a userform to be the same as the caption property of the label
(there's loads of labels).
It seemed like it should have been easy, but after much trial and
error I've managed to come up with the following (which I don't quite
follow) and feels so close, but I'm stumped as to get the caption in
there:
Sub Change_Labels_UserForm()
Dim oVBProj, oVBComp As Object
Dim ctl As Control
Set oVBProj = ThisWorkbook.VBProject
On Error Resume Next
For Each oVBComp In oVBProj.VBComponents
If oVBComp.Type = 3 Then
For Each ctl In oVBComp.Designer.Controls
If Left(ctl.Name, 5) = "Label" and ctl.ControlTipText = ""
Then ctl.ControlTipText = 'caption name
Next
End If
Next
End Sub
Any ideas?
Cheers,
JF
This is driving me insane!!!
I'm trying to have the text of all of the controltiptext properties on
a userform to be the same as the caption property of the label
(there's loads of labels).
It seemed like it should have been easy, but after much trial and
error I've managed to come up with the following (which I don't quite
follow) and feels so close, but I'm stumped as to get the caption in
there:
Sub Change_Labels_UserForm()
Dim oVBProj, oVBComp As Object
Dim ctl As Control
Set oVBProj = ThisWorkbook.VBProject
On Error Resume Next
For Each oVBComp In oVBProj.VBComponents
If oVBComp.Type = 3 Then
For Each ctl In oVBComp.Designer.Controls
If Left(ctl.Name, 5) = "Label" and ctl.ControlTipText = ""
Then ctl.ControlTipText = 'caption name
Next
End If
Next
End Sub
Any ideas?
Cheers,
JF