Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Font enlarge/reduce by 1 pt?

Is there syntax for reducing and enlarging font by 1 pt? What I mean by
that is so that if font in cell is 10pt, by clicking enlarge font by 1 pt,
it would increase to 11pt, and it we clicked again it would go to 12pt?

And the opposite, syntax to do "-1" point?

Thanks. :oD


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Font enlarge/reduce by 1 pt?

You can use code like the following:

Sub ChangeFontSize()

Dim Res As VbMsgBoxResult
Dim R As Range
Dim N As Long

Res = MsgBox("Do you want to increase the size of the font?" & vbCrLf & _
"Click 'Yes' to enlarge the size of the font by one point." & vbCrLf & _
"Click 'No' to reduce the size of the font by one point." & vbCrLf & _
"Click 'Cancel' to terminate the operation.", vbYesNoCancel)

Select Case Res
Case vbYes
N = 1
Case vbNo
N = -1
Case Else
Exit Sub
End Select

If TypeOf Selection Is Excel.Range Then
For Each R In Selection.Cells
With R.Font
.Size = .Size + N
End With
Next R
End If

End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"StargateFanFromWork" wrote in message
...
Is there syntax for reducing and enlarging font by 1 pt? What I mean by
that is so that if font in cell is 10pt, by clicking enlarge font by 1 pt,
it would increase to 11pt, and it we clicked again it would go to 12pt?

And the opposite, syntax to do "-1" point?

Thanks. :oD


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Font enlarge/reduce by 1 pt?

Sub bumpit()
For Each r In Selection
r.Font.Size = r.Font.Size + 1
Next
End Sub

you can do something similar to make a shrinkit, but be usre to check for
not less than one.
--
Gary''s Student - gsnu200764


"StargateFanFromWork" wrote:

Is there syntax for reducing and enlarging font by 1 pt? What I mean by
that is so that if font in cell is 10pt, by clicking enlarge font by 1 pt,
it would increase to 11pt, and it we clicked again it would go to 12pt?

And the opposite, syntax to do "-1" point?

Thanks. :oD



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Font enlarge/reduce by 1 pt?

selection.cells.font.size = selection.cells.font.size + 1
or -1 for reducing the font size.

HTH
Kalpesh
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
Any Way to Enlarge the Tabs? Lauranator Excel Discussion (Misc queries) 1 October 21st 09 07:53 PM
paste cells (and reduce font size) from excel into outlook nomad quandry Excel Worksheet Functions 1 May 25th 09 11:06 AM
enlarge name box Miri Excel Discussion (Misc queries) 1 January 16th 07 02:21 PM
HOW DO I ENLARGE THE FONT ON A DROP-DOWN LIST MARK M Excel Worksheet Functions 2 October 15th 06 01:22 PM
How do I enlarge font in a drop-down list in EXCEL? Stan Excel Discussion (Misc queries) 2 February 21st 05 10:30 PM


All times are GMT +1. The time now is 10:31 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"