Find certain "Row" (in Column B), then find last cell in same Row (in Column H) to reformat

afterdinnerspeaker

Board Regular
Joined
Jan 10, 2019
Messages
70
Hi Everyone!

I use the following lines of code to find words "TOTAL REVENUE" in Column "B", then insert one blank row above that row:

Set Fnd = Range("B:B").find("TOTAL REVENUE", , , xlWhole, , , True, , False)
If Not Fnd Is Nothing Then Fnd.EntireRow.Insert

PROBLEM: After finding that Row (and before inserting another row), I'd like to reformat the last "used" cell (containing a number) in that row which will be in Column "H"
Then, I want to reformat that cell by removing highlighting, bolding & font color leaving the figure in black with no formatting
Finally, I'd like to insert a blank row above the row containing "TOTAL REVENUE"

Hoping someone can help me,

Jerry
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
VBA Code:
Set fnd = Range("B:B").Find("TOTAL REVENUE", , , xlWhole, , , True, , False)
If Not fnd Is Nothing Then
    With Cells(fnd.Row, "H")
        .Font.FontStyle = "Regular"
        .Font.ColorIndex = xlAutomatic
        .Interior.Pattern = xlNone
    End With
    fnd.EntireRow.Insert
End If
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top