Excel 2013 apply bold with .Replace

Greemo

New Member
Joined
May 22, 2014
Messages
42
Hi,

I have the following code which makes any cells with strikethrough formatting as blank cells.

Code:
Application.FindFormat.Clear
  Application.FindFormat.Font.Strikethrough = True
  Range("TodoCons").Replace "*", "", SearchFormat:=True
  Application.FindFormat.Clear

Can I have some help with, prior to making these cells blank, setting the bold fontstyle as false for all the cells with strikethrough formatting?

Thank you,

Greemo
 

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.
Hi,

I have the following code which makes any cells with strikethrough formatting as blank cells.

Code:
Application.FindFormat.Clear
  Application.FindFormat.Font.Strikethrough = True
  Range("TodoCons").Replace "*", "", SearchFormat:=True
  Application.FindFormat.Clear

Can I have some help with, prior to making these cells blank, setting the bold fontstyle as false for all the cells with strikethrough formatting?
Excel seems finicky about trying to do everything all at once when using the Replace method. This code seems to do what you want, though..
Code:
  Application.FindFormat.Clear
  Application.FindFormat.Font.Strikethrough = True
  Application.ReplaceFormat.Font.Bold = False
  Application.ReplaceFormat.Font.Strikethrough = False
  Range("TodoCons").Replace "*", "#N/A", SearchFormat:=True, ReplaceFormat:=True
  Application.FindFormat.Clear
  Range("TodoCons").SpecialCells(xlConstants, xlErrors).ClearContents
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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