![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Is it possible to change font size in a cell based on a criteria. I'm trying to make cells that contain a formula appear in a larger font size.
Thanks!!! Doug |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,383
|
Right click on your sheet tab, left click on View Code, and paste this in. Modify for font size. The error trap is for the occasions when no formulas exist on the sheet.
Private Sub Worksheet_Change(ByVal Target As Range) On Error Resume Next Cells.SpecialCells(xlCellTypeFormulas, 23).Font.Size = 24 End Sub Tom Urtis |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
I think you would have to "reset" all cells font size, before changing the cells with formulas, like this
Cells.Font.Size = 12 and then do what Tom suggested: Cells.SpecialCells(xlCellTypeFormulas, 23).Font.Size = 24 |
|
|
|
|
|
#4 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Can you assign a range for the font size of 24 to take affect?
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Do you mean like this ?
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Perfect! If it's not too much to ask, can I also format color and bold/italic? Also center in the cell?
[ This Message was edited by: DaKen on 2002-02-21 06:00 ] |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
You can use the macro recorder to get the appropiate commands
|
|
|
|
|
|
#8 |
|
New Member
Join Date: Feb 2002
Posts: 43
|
Thanks again for your patience and help. I really appreciate the opportunity to access this type of forum!
Doug |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|