Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default CHANGING FONT SIZE

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default CHANGING FONT SIZE

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.

In article ,
gwbdirect wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default CHANGING FONT SIZE

Hi JE,\
I put the code in the THISWORKBOOK MODULE.
hOW DO i MAKE IT RUN. Do I need to set up a button.

"JE McGimpsey" wrote:

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.

In article ,
gwbdirect wrote:

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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default CHANGING FONT SIZE

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.



gwbdirect wrote:

Hi JE,\
I put the code in the THISWORKBOOK MODULE.
hOW DO i MAKE IT RUN. Do I need to set up a button.

"JE McGimpsey" wrote:

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.

In article ,
gwbdirect wrote:

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.



--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM
Changing the font size in the charts navin Excel Programming 1 April 13th 07 01:16 PM
Changing the font case size across a worksheet HDV Excel Discussion (Misc queries) 1 December 6th 05 10:04 PM
automatically changing font size Jared Excel Programming 1 January 17th 05 05:22 PM
Changing font size in a list box [email protected] Excel Discussion (Misc queries) 1 December 21st 04 04:07 PM


All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"