View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Zone Zone is offline
external usenet poster
 
Posts: 269
Default Font in Userform

OK, thanks.
witek wrote:
go to tools/macro/secuity, click trusted publishers and select trust
access to visual basic projects.



Zone wrote:
Tom, Is this standard VBA, put in a standard module? I get error
"Programmatic access to form not trusted" or something like that.
Never seen that one before! If I reset and run again, I get error
"Method VB Object of _Workbook failed".
James

Tom Ogilvy wrote:

Sub Changefont()
Dim fnt As Font
Dim ctrl As Object
Dim frm As Object
Set frm = ThisWorkbook.VBProject.VBComponents("Userform1")
For Each ctrl In frm.Designer.Controls
On Error Resume Next
ctrl.Font.Name = "Arial"
On Error GoTo 0
Next

End Sub

--
Regards,
Tom Ogilvy


"Bill" wrote:


Hello,
I would like to change the font in mutliple userforms that contain a variety
of items such as frames, textboxes, etc. Decided I don't like the way the
userforms look and would like to try other fonts. Is there code that can be
written to change the font in userforms? Doesn't seem possible to me.

Thanks,

Bill