Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using bold and normal font within one cell
In Excel you can manually change some of the formatting
for part of a cell. This allows you for example to only make selected parts of the contents of the cell bold rather than everything. Does anyone know how you can do this with VBA? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using bold and normal font within one cell
Here is one I just recorded. Of course it needs a LOT of cleaning up to do
just what you want. But, you get the idea. BTW, you cannot do this with a formula. Sub Macro3() ' ' Macro3 Macro ' Macro recorded 1/8/2004 by Don Guillett ' ' Range("E9").Select ActiveCell.FormulaR1C1 = "Date" With ActiveCell.Characters(Start:=1, Length:=2).Font .Name = "Courier" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With With ActiveCell.Characters(Start:=3, Length:=2).Font .Name = "Courier" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 3 End With Range("E5").Select End Sub -- Don Guillett SalesAid Software "Paul" wrote in message ... In Excel you can manually change some of the formatting for part of a cell. This allows you for example to only make selected parts of the contents of the cell bold rather than everything. Does anyone know how you can do this with VBA? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using bold and normal font within one cell
Paul
Sub CellFont() With ActiveCell.Characters(Start:=1, length:=3).Font .ColorIndex = 3 .Bold = True .Underline = True End With With ActiveCell.Characters(Start:=4, length:=3).Font .Superscript = True .ColorIndex = 5 End With End Sub Adjust to suit. Gord Dibben Excel MVP On Thu, 8 Jan 2004 08:41:48 -0800, "Paul" wrote: In Excel you can manually change some of the formatting for part of a cell. This allows you for example to only make selected parts of the contents of the cell bold rather than everything. Does anyone know how you can do this with VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If Cell is Blank (Though a Link), Hide Result, Else Normal Font | Excel Worksheet Functions | |||
if font is bold then cell value is number | Excel Discussion (Misc queries) | |||
How to count number of Cell have Strike Through Effect & Bold as font style. | Excel Discussion (Misc queries) | |||
how do i make one part of my formula bold and the other normal? | Excel Worksheet Functions | |||
Can you keep a cells BOLD Font, cell color size | Excel Discussion (Misc queries) |