Default formatting settings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My application adds new worksheets to an open workbook to perform separate
calculations. These worksheets are formatted programmatically, containing
e.g. comboboxes. To ensure correct layout the standard font should be Arial,
size=11. I want to make sure that all users have this setting as default when
they work with this application. I tried this, but without success though:

With Application
.StandardFont = "Arial"
.StandardFontSize = "11"
End With

I put this code on the OK button on a form that adds a new sheet.
 
Directly after you add the new sheet in your code, you could just use:

Cells.Font.Name = "Ariel"
Cells.Font.Size = 11

to format the sheet.
 
your solution just sets it for each new workbook created
after your apply the settings.

For existing workbooks following would probably work ok.

Sub ResetFont()
With ActiveWorkbook
Dim ws
With .Styles("Normal").Font
.Name = "Arial"
.Size = 11
End With
For Each ws In .Worksheets
ws.UsedRange.Font.Name = "Arial"
'leave sizes intact..
Next
End With

End Sub


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top