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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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,282
Messages
6,124,052
Members
449,139
Latest member
sramesh1024

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