|
Peltier Tech
Buy me a coffee If this topic or the whole site has been helpful, please support further development by treating me to a cup of coffee. |
Fix Chart Font Scaling.
Hate the way Excel mucks up your chart font sizes when you resize the chart? So do I, and here's how I counteract the default font scaling. Fixing Font Autoscaling ManuallyYou can format individual chart elements one-by-one to romove the font autoscaling. When the Format dialog comes up, make sure the Auto Scale checkbox on the Font tab is unchecked. If you select the chart area and format the font, it will affect all font elements which are visible at the time, but font elements added later may have the autoscaling activated. If desired, you can reactivate font autoscaling by again checking the Auto Scale box.
Fixing Font Autoscaling with VBAYou can write VBA procedures to disable chart font autoscaling. This short procedure will turn off font autoscaling for the active chart:
Sub FixOneChartFont()
' Disable Font Autoscaling on Active Chart
ActiveChart.ChartArea.AutoScaleFont = False
End Sub
You can reinstate font autoscaling by changing False to True. This short procedure will turn off font autoscaling for all charts on the active sheet:
Sub FixAllChartFonts()
' Disable Font Autoscaling on All Charts on Active Sheet
Dim myCht As ChartObject
For Each myCht In ActiveSheet.ChartObjects
myCht.Chart.ChartArea.AutoScaleFont = False
Next
End Sub
Changing the Default Font Autoscaling BehaviorUnfortunately, the manual and VBA procedures described above only work for existing charts. You can adjust the Windows registry to change the default autoscaling behavior. Here are the registry hacks that will permanently disable font autoscaling in each new chart you make: Office 97HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Excel\Microsoft Excel Add a String Value Value Name: AutoChartFontScaling Value Data: "0" Office 2000HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Options Add a New DWORD Value Name: AutoChartFontScaling Value Data: "0" Office XP (2002)HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Excel\Options Add a New DWORD Value Name: AutoChartFontScaling Value Data: "0" Office 2003I haven't checked this hack in Office 2003, but the registry structure is the same as in Office 2000 and XP, so presumably the same change will have the desired effect. HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Options Add a New DWORD Value Name: AutoChartFontScaling Value Data: "0" Note: Making changes to the Windows registry could lead to errors in the operation of your computer. Before making any changes, back up the registry. Make only one change at a time, then exit the registry editor and use the computer for a while to make sure you have not caused any unintended changes. Microsoft Knowledge Base Articles Discussing Charts and Font LimitationsXL97: "Not Enough Memory" Error When You Add Chart to Workbook (Q168650) XL97: How to Turn Off Automatic Font Scaling in All Charts (Q292263) XL97: Error Copying Worksheets Containing Charts (Q264986) XL2000: Error Copying Worksheets Containing Charts (Q215573) |
Peltier Technical Services, Inc.Custom Solutions | Commercial Utilities | Training | Charts and Tutorials | PTS BlogPeltier Technical Services, Inc., Copyright © 2009. All rights reserved. |