?
Solved

Excel change font size automatically if too many characters

Posted on 2016-08-29
5
Medium Priority
?
65 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 32

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 2000 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 32

Expert Comment

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

Expert Comment

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

765 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