when adding a row bold type the font for that row

vba excel 2013

What I need:
When the code inserts a row..i need the row inserted to be bold faced type for that row.

Function Find_Match(xSheet As Worksheet, xSKU As Variant, ByVal xOut_Row As Long, xMaster_Row As Long, xLast_Row As Long)
Dim xFind As Range
Dim xLast As Range
Dim xFirst As Boolean

xFirst = True
Set xLast = xSheet.Range("A" & xLast_Row + 1)

Do

    Set xFind = xSheet.Range("A:A").Find(what:=xSKU, AFTER:=xLast, LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByRows _
            , searchdirection:=xlNext, MatchCase:=False)
            
    If Not xFind Is Nothing Then
        
        If Not xFirst And xFind.Row <= xLast.Row Then
            Set xFind = Nothing         ' We've looped around.
        Else
            Debug.Print "+++ " & xFind.Address
            If xOut_Row <> xMaster_Row Then
                Rows(xOut_Row).Insert Shift:=xlDown
            End If
' this line copies data
            Range("B" & xOut_Row & ":T" & xOut_Row) = xFind.Offset(0, 1).Resize(1, 19).Value 'copy B:W values
' bold face type the font on the new row that was added here   <------------------------            
' I tried this
' Range("B" & xOut_Row & ":T" & xOut_Row) .cells.font.bold

xFirst = False
            Set xLast = xFind
            xOut_Row = xOut_Row + 1
            Debug.Print " - " & xFind.Row & " - " & xOut_Row
            
        End If
        
    End If

Loop Until xFind Is Nothing

Find_Match = xOut_Row

End Function

Open in new window



Thanks
fordraiders
LVL 3
FordraidersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FamousMortimerCommented:
like this?

                If xOut_Row <> xMaster_Row Then
                    Rows(xOut_Row).Insert Shift:=xlDown
                    Rows(xOut_Row).Font.Bold = True
                End If

Open in new window


or you can change the line you commented out to
Range("B" & xOut_Row & ":T" & xOut_Row).Font.Bold = True

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FordraidersAuthor Commented:
aaaah.i tried all the other lines///


Thanks
works great !
0
FordraidersAuthor Commented:
Sorry, one additionl request.
To make the font color red ?
0
FordraidersAuthor Commented:
Rows(xOut_Row).Font.ColorIndex = 3 'Red
0
FordraidersAuthor Commented:
Thanks !!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.