Insert Blank row before bold text

cpeaks

New Member
Joined
Nov 6, 2017
Messages
1
I have a a weekly excel file that I need to add a blank row before Item Title. The title is always doen with a bold type face, is there a way to search for certain font criteria i.e. "BOLD" and have a new blank row inserted before that row?

I look forward to your assiastance as I am trying to learn.

Thank you,
Chris Pecor
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try recording a macro
Search>leave Find What blank>select Format > then select font & Bold
 
Upvote 0
Assuming you will never have two bold cells next to each other in Column A, here is a macro solution whose code the macro recorder will never give you...
Code:
[table="width: 500"]
[tr]
	[td]Sub KeepNumbersAndFirstNonNumbers()
  Dim UnusedCol As Long
  UnusedCol = Cells.Find("*", , xlFormulas, , xlByColumns, xlPrevious).Column + 1
  Application.ScreenUpdating = False
  Columns("A").Copy Cells(1, UnusedCol)
  Application.FindFormat.Clear
  Application.FindFormat.Font.Bold = True
  Columns(UnusedCol).Replace "*", "", SearchFormat:=True, ReplaceFormat:=False
  Application.FindFormat.Clear
  On Error Resume Next
  Columns(UnusedCol).SpecialCells(xlBlanks).EntireRow.Insert
  On Error GoTo 0
  Columns(UnusedCol).Clear
  Application.ScreenUpdating = True
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,861
Members
449,411
Latest member
adunn_23

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