Selection.Font.Bold = True

S

Steved

Hello from Steved

The below works fine but I would like to bold the,

"REDUCED PEAK 2008 - 2009" please,

I've not sure where to insert Selection.Font.Bold = True

as it is not working, What do I need to do please to have this working, I
thankyou.

Sub REDUCEDPEAK()
Cells.Replace What:="Auckland", Replacement:="REDUCED PEAK 2008 - 2009", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:= _
False, ReplaceFormat:=False
Selection.Font.Bold = True
Selection.Copy
Application.CutCopyMode = False
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
ActiveWorkbook.Close SaveChanges:=False
ActiveCell.Offset(2, 0).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

End Sub
 
B

Bernard Liengme

Do this:
Turn on Macro Record
In some cell type: Mary had a little lamb. It fleece was white
Select "little lamb" and make bold
Turn off Recorder
Look at the subroutine in VBA
It will have something like

With ActiveCell.Characters(Start:=6, Length:=12).Font
.Name = "Calibri"
.FontStyle = "Bold"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With

best wishes
 
S

Steved

Hello Bernard from Steved

I thankyou

Below is what I achieved.


Sub REDUCEDPEAK()
Cells.Replace What:="Auckland", Replacement:="REDUCED PEAK 2008 - 2009", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:= _
False, ReplaceFormat:=False
Cells.Find(What:="REDUCED PEAK 2008 - 2009", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.Font.Bold = True
Application.CutCopyMode = False
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
ActiveWorkbook.Close SaveChanges:=False
ActiveCell.Offset(2, 0).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top