Format cell
I don't know. I did it manually and recorded:
ActiveCell.FormulaR1C1 = "abcd-efgh"
Range("F3").Select
ActiveCell.FormulaR1C1 = "abcd-efgh"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleSingle
.ColorIndex = xlAutomatic
End With
With ActiveCell.Characters(Start:=5, Length:=5).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("G3").Select
Which could be culled down to
Sub mySub()
With ActiveCell
.FormulaR1C1 = "abcd-efgh"
With .Characters(Start:=1, Length:=4).Font
.Bold = True
.Underline = True
End With
End With
End Sub
--
Regards,
Tom Ogilvy
"RatherBeeHome" wrote:
Tom,
I turned the Macro Recorder on. When I BOLD the item manually, I get a
message that says, "Unable to record". What is going on?
"Tom Ogilvy" wrote:
turn on the macro recorder and do it manually.
Turn off the macro recorder and look at the code.
--
Regards,
Tom Ogilvy
"RatherBeeHome" wrote:
Hello,
I am pulling two different fields from an Access database and putting them
into one cell in Excel. This works fine. What I need to know is to BOLD and
UNDERLINE the first field in the cell but not the second field. Can this be
done?
The variable names a
var_ID
Var_Name
|