Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

CHANGING FONT SIZE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gwbdirect - 12 Sep 2007 20:32 GMT
I have a list in excel that needs to be printed within a certain space
variable data.
Is there a way to set up a formula/macro that will change the font size if
there are more than say 60 characters but leave any less than 60 characters
the same size.
JE McGimpsey - 12 Sep 2007 20:52 GMT
Formulas can't change formatting such as font size.

One possibility:

Put this in the ThisWorkbook code module:

   Private Sub Workbook_BeforePrint(Cancel As Boolean)
       With Worksheets("Sheet1").Range("A1")
           If Len(.Text) > 60 Then .Font.Size = 8
       End With
   End Sub

Change your worksheet and cell to change.

> I have a list in excel that needs to be printed within a certain space
> variable data.
> Is there a way to set up a formula/macro that will change the font size if
> there are more than say 60 characters but leave any less than 60 characters
> the same size.
gwbdirect - 12 Sep 2007 21:38 GMT
Hi JE,\
I put the code in the THISWORKBOOK MODULE.
hOW DO i MAKE IT RUN. Do I need to set up a button.

> Formulas can't change formatting such as font size.
>
[quoted text clipped - 15 lines]
> > there are more than say 60 characters but leave any less than 60 characters
> > the same size.
Dave Peterson - 12 Sep 2007 22:40 GMT
You don't need to do anything special--except allow macros when you open the
workbook.

The workbook_beforeprint will fire each time you use print or print preview.

> Hi JE,\
> I put the code in the THISWORKBOOK MODULE.
[quoted text clipped - 19 lines]
> > > there are more than say 60 characters but leave any less than 60 characters
> > > the same size.

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.