Solved

Excel change font size automatically if too many characters

Posted on 2016-08-29
5
60 Views
Last Modified: 2016-08-30
I have a cell that I want to change font size to be as large as possible to fill cell height.
But, I want the font size to change when I have more characters.
Example.... I want cell height and width to maintain, but there are too many characters.
So, we need to reduce font size.  (I am using column C for the data, and the putting in column A by =C3)
cell size cannot change, but I want to change font size automatically
Hope this makes sense.
Thanks
0
Comment
Question by:chris pike
  • 3
5 Comments
 
LVL 30

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41775091
Maybe this......

Sub SetFontSizeToAutofit()
With Range("A:A")
   .WrapText = False
   .ShrinkToFit = True
End With
End Sub

Open in new window

0
 

Author Closing Comment

by:chris pike
ID: 41776267
Works for me. Thanks
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 41776270
Good one Neeraj.
1
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41776275
You're welcome Chris! Glad to help.
0
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41776277
@ Professor
Thanks for the appreciation. :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question