Naming userforms

G

Greg B

Is there a cheat's way of changing the caption on many userform names in the
vb editor or do I have to go into them 1 by 1.

I have about 80 of them I need to change

Please advise

Greg
 
B

Bob Phillips

Hi Greg,

Here's some code that shows you an approach.

Dim oVBMod As VBComponent
Dim i As Long

With ActiveWorkbook.VBProject
For Each oVBMod In .VBComponents
If oVBMod.Type = vbext_ct_MSForm Then
i = i + 1
oVBMod.Properties("Caption") = "myForm" & i
End If
Next oVBMod
End With

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Greg B

Thanks Bob

I have so many items which use the same caption

I was going mad typing the same thing

Thanks Again
Greg
 
Top