Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default restricting fonts

Hi,
Is there any way to restrict fonts programmatically in a Excel template?

Thank you,
Ernesto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default restricting fonts

Hi Ernesto,

From my understanding to your issue, you are going to perform some
configuration for the fonts when the workbook is created based on one
customized workbook.

So far as I know, you can create one template with one specified font name
and size in Excel. The kb article 825577 introduces this method for you.
825577 HOW TO: Change the Default Font in Excel 2003
http://support.microsoft.com/?id=825577

If you want to programmatically change the font name and size, you can
create one procedure for the workbook open event and perform the
configuration. I have created one sample code for you.
'Code begin ----------------------------------------------------
Private Sub Workbook_Open()
Dim objSht As Worksheet
Set objSht = ActiveSheet

For Each objSht In ActiveWorkbook.Sheets
objSht.Select
Cells.Select
With Selection.Font
'please change the font properties according to your scenario
.Name = "Simple Bold Jut Out"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
Cells(1, 1).Select
End With
Next
ActiveWorkbook.Sheets(1).Select
End Sub
'Code end ------------------------------------------------------

Please create one empty excel workbook and then open the VBA editor, paste
the codes above into the "ThisWorkbook" file in the VBA editor. Then save
this workbook as one template. With this template, you can create the
workbook with the customized font.

Please feel free to let me know if there is any further question on this
issue. I am standing by to be of assistance.

Thanks for posting in the community!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting entry scubas Excel Worksheet Functions 1 January 11th 10 02:34 PM
restricting use of certain characters Rob Excel Discussion (Misc queries) 4 June 8th 06 01:07 AM
How can I lengthen the drop down Fonts list to show more fonts at Moser D Excel Discussion (Misc queries) 1 February 5th 06 03:24 PM
Restricting cells Noctos[_13_] Excel Programming 5 January 3rd 04 05:09 PM
Restricting Menus R. Todd Miller[_2_] Excel Programming 1 November 6th 03 09:05 PM


All times are GMT +1. The time now is 09:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"