delete text with certain fonts

kylefoley76

Well-known Member
Joined
Mar 1, 2010
Messages
1,553
I've got a doc that was converted into text from a book by a computer, consequently there are a lot of mistakes. Any text that is not in times new roman is a mistake and needs to be deleted. How do I write a macro for that? Any text in a font greater than or equal to 18, or less than or equal to 10 is also a mistake. How do I write a macro for that?

Any help would be greatly appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I have no solution to this question, but I'd like to know how to remove all Comic Sans from the world. Is there a macro for that? ;)
 
Upvote 0
This might do what you are after...
Code:
Sub KeepTimesNewRoman10to18()
  Dim C As Range
  Application.ScreenUpdating = False
  For Each C In ActiveSheet.UsedRange
    If C.Font.Name <> "Times New Roman" Or C.Font.Size < 10 Or C.Font.Size > 18 Then C.Clear
  Next
  Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,487
Members
452,917
Latest member
MrsMSalt

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