How to set the default font in Excel. How to set your default Excel workbook. Installing a downloaded font

2

We have Excel 2013-2016 add-in in C#. We use the following get worksheet font method:

Var defaultFont = Microsoft.Office.Interop.Excel.Worksheet.Cells.Font

Everything worked until the user changed the font of a specific cell. For example, the user changed cell A1 and set the font to "Arial". By default we have the font "Calibri". After this, when we try to get the default font on Worksheet.Cells.Font we get nothing - just an empty object. I guess due to ambiguity: A1 has the font "Arial", the other cells have the default font "Calibri". My goal is to get the default font, i.e. "Caliber". So far I have re-written my code, and now I also check the Styles:

This solution returns exactly what I need - my "Calibri" font. But then I discovered that this is the default font used for all new worksheets/workbooks (it can be customized in Excel options). It doesn't work if the user selected all the cells in the worksheet and changed the default font to "Times New Roman" then I would get "Calibri" because that is the default font that will be used after creating a new worksheet/workbook. Again I'm facing an issue where I can't get the actual default font for the current worksheet. My next thought was to get the font of some specific cell on the edge of the sheet, not much use to users as:

Var defaultFont = workSheet.Cells.Font

It looks pretty weird, but it works. My guess is that the user is not using the last cell on the sheet. (1048576 and 16384 - max size of worksheet). I don't know the implications of this method, so I'm wondering if there is some "legal" way to get the default desktop font without such a crutch?

  • 1 answer
  • Sorting:

    Activity

0

You were on the right track when using:

Var workbookFont = Microsoft.Office.Interop.Excel.Worksheet.Parent.Styles["Normal"].Font;

Normal style is the default font for the sheet, but the sheet may not actually have any instances of the default font (or Normal style), or all cells decorated with the Normal style may have the font overridden in each cell format.

If the user applies their own fonts in different ranges, then the sheet will potentially have numerous fonts and no one of these is guaranteed to be the same as the Normal style font. Font.Name may vary across sheets, in which case Font.Name returns null , although Font.Size may be sequential (or if not, it returns null too).

When a user applies a special font in a range that already has Normal style, then Style remains connected with a range, and the font overlaps any font defined in the style.

Moreover, it is common practice to select All cells on the sheet when the UsedRange font changes (so that the height of the rows is adjusted proportionally), even if the UsedRange is only a small part of all Cells .

So you should choose a font that representative fonts that are used in the sheet, or apply fonts to new ranges as if they were Normal. This choice should be informed by what you know about the sheet, and what you're going to do with the font:

    If you insert a column or row, then I believe you are mimicking Excel's behavior and using adjacent formats.

    If you are adding a new range that is not adjacent to UsedRange then you are probably want to default to Normal style.

    If you are looking for a representative UsedRange font, you may want to avoid the first few rows and columns as they tend to be headings and the last rows can sometimes be summary. You will need to iterate over the cells in the range to find the appropriate cell format.

    If you are rendering the worksheet contents in a different format, you will need to check the font of each cell and each cell in UsedRange .

The bottom rightmost cell is not necessarily any more or less similar to Normal or the fonts used in UsedRange , so I wouldn't recommend using it.

class="eliadunit">

So, you are one of those people who are tired of changing the standard font and its size every time in Excel 2010 from Calibri 11 to another one you love and need, then it’s time to change the default font for all new books created. Many people prefer Times New Roman or Arial or Verdana fonts. Others make changes to the initial font in offices where there are many computers and different versions Microsoft Excel, and so to speak for unification different versions configure uniform settings, including font and size.

Changing the default font occurs without additional applications and plugins themselves Microsoft settings Excel 2010. Therefore, you will not need anything other than Microsoft Excel 2010. To go to Excel settings version 2010 go to File => Options

If you have problems with the mouse, then these steps can also be performed on the keyboard. To do this, in the program, press the combination Alt + T, and then the letter O. Then in the window that appears, go to General ( Common parameters implied):

class="eliadunit">

Then we select the font we need and its size, keep in mind that some fonts are not intended for the Russian language (Cyrillic), so choose a familiar display of letters, to exclude the installation of a character font or a hieroglyph font.

Next, click OK. For the changes to take effect, you should restart Microsoft Excel 2010 and verify the changes made. To return Calibri 11 back or install another font, a similar operation is performed, which can be done an inexhaustible number of times. Font setting is one of basic settings, which we just did, this makes it possible to optimize the work and adjust it to suit your business.

Have a good start in Excel 2010!

  • Troubleshooting errors when running Office 2010 on XP
  • How to update Internet Explorer 8 to version 11 for Windows 7?

Of course, in Excel, you can change the font size in the Font Size dropdown, but if you want to increase or decrease the font size just by using some keyboard shortcuts, how can you solve it in Excel?

Increase or decrease font size using keyboard shortcuts

Here are some keyboard shortcuts to increase and decrease the text font size for the selected cell(s), please do the following:

Increase font size, click Alt+H and then click FG keyboard keys;

Reduce font size, click Alt+H and then click FK keys on the keyboard.

Increase or decrease font size using special keyboard shortcuts

If the above shortcut keys are hard to remember, you can create your own keys here quick access. Please follow these steps:

1 ,Hold ALT+F11 and opens Microsoft Visual Basic for applications window.

2 . Click Insert > module, and paste the following code into Module window.

VBA code: Increase or decrease font size using special keyboard shortcuts:

Sub MakeBigger() Selection.Font.Size = Selection.Font.Size + 1 End Sub Sub MakeSmaller() Selection.Font.Size = Selection.Font.Size - 1 End Sub

3 . After pasting the code, save and close the window and click developer >Macro, see screenshot:

4. In the appeared Macro in the dialog box select MakeBigger macro in the list, and then click Options button to go to Macro Options dialog box, specify the key combination to increase the font size in Hotkeys section, see screenshot:

5 , Then click OK, select MakeSmaller macro from the list, and then click Options button to go to Macro Options dialog box, specify the key combination to reduce the font size in Hotkeys section, see screenshot:

6 , Then click OK and close the macro dialog, now when you click Ctrl+O, the selected cell font size will be increased, and when you click Ctrl+P, the font size will be reduced as needed.

Recommended tools to improve productivity in Excel

Kutools for Excel helps you always finish your work ahead of time and stand out from the crowd

  • More than 300 powerful advanced features designed for 1500 work scenarios, increasing productivity by 70%, giving you more time to take care of your family and enjoy life.
  • No more memorizing formulas and VBA codes, give your brain a rest.
  • Become an Excel expert in 3 minutes. Complex and repetitive operations can be completed in seconds,
  • Reduce thousands of keyboard and mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 high-performing people and a selection of 300+ world-renowned companies.
  • 60-Day fully functional free trial version. 60-day money back guarantee. 2 years free update and support.

Provides tabbed viewing and editing in Microsoft Office, much more powerful than browser tabs

  • The Office tab is for Word, Excel, PowerPoint and more Office applications: Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs in the same window, rather than in new windows.
  • Increases your productivity by 50% and reduces hundreds of mouse clicks for you every day!

How to Change the Default Font in Microsoft Excel

In Word, you can change the default font through the font settings window, well that makes sense to you. However, when you have permission to the same area in Excel (which you can do by clicking Ctrl-Shift-F), unfortunately you will not find such a function or option. Fortunately, it is not difficult, to make changes, you need to know where to look for such a change. (Notice, that this information Applies to Excel 2010 and 2013; I assure you that this is the same in earlier versions.)

1. Start Excel and open a new or existing workbook.
2. From the File menu, open Options.
3. In the General section, find "When creating new books". The very first option select the feature: "Use this as your default font."

Then select the font you want, and then click OK. (You will change the default font size if you want).

Now, whenever you start creating new book, Excel should by default use the font that you specified yourself.


In Excel, font selection is made on the "Font" tab of the "Format Cells" dialog box. The worksheet uses fonts to visualize information. various types and, in particular, to highlight headings. To set the font for a cell or range, first select the cell or range. From the Format menu, select the Cells command (Ctrl+1) and then go to the Font tab.

Choosing a font and its size

To select a font, click its name in the font list or enter its name in the Font field. The number in the Size field can change and will indicate the font size at which Excel can optimally print data in the selected font. You can use the Size list scroll bar to see all available font sizes. To set the size, simply click on the desired number in this list. If you haven't set the row height in advance, Excel will automatically adjust it according to largest size font used in this line.

To specify a size that is not listed, highlight the contents of the Size field and enter a new number. The optimal design of output documents is usually obtained by selecting the sizes that are available in the "Size" list.

Selecting font styles and effects

The suggested set of styles depends on the selected font. In addition to the regular style, most fonts offer italic, bold italic and semibold styles. Simply select the style you want to use from the Style list on the Font tab. The result of your selection can be seen in the Sample area.

The Underline list offers four underlining options: single by value; double in value; single cell; double per cell. In the "Video Edit" area there are checkboxes for three effects: Strikethrough; Superscript; Subscript.

Color selection

To see the available colors, on the Font tab of the Format Cells dialog box, click the arrow to the right of the Color combo box. If you select Auto, Excel will display the contents of the cell in black. You can also change the color of characters using the Font Color button on the Formatting toolbar. Clicking this button applies the color shown in the rectangle on the button to the selection. Clicking the arrow to the right of the Font Color button opens a color palette. Click one of the color squares to apply color to the contents of the selected cells. This button has a detachable palette. This means that once you open a palette, you can drag it from the toolbar. After selecting a color in the palette, the color of the rectangle on the button will change, and it can later be applied without using the palette by simply pressing the button.