Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Font enlarge/reduce by 1 pt?
selection.cells.font.size = selection.cells.font.size + 1
or -1 for reducing the font size. HTH Kalpesh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Any Way to Enlarge the Tabs? | Excel Discussion (Misc queries) | |||
paste cells (and reduce font size) from excel into outlook | Excel Worksheet Functions | |||
enlarge name box | Excel Discussion (Misc queries) | |||
HOW DO I ENLARGE THE FONT ON A DROP-DOWN LIST | Excel Worksheet Functions | |||
How do I enlarge font in a drop-down list in EXCEL? | Excel Discussion (Misc queries) |