strikethrough

Haydo

Board Regular
Joined
Sep 5, 2011
Messages
95
Is there a way to....
- find (and highlight?) all cells containing - just the three letters - scr
- then strikethrough all text on all rows containing scr ?

Is a vba code best for this or something else?

Thanks in advance
 
interesting...
The result is that each of the "scr" cells are coloured red, with black ink, and with strikethrough.
But the remainder of the row is unchanged.

When i said highlight, I meant in the sense that the cells would then be able to be changed all at once, just like when you hold down 'CTRL' and choose multiple cells which are then ready to be changed.

My aim is to have the entire row (containing the "scr") with a strikethrough, but have no colour change.
Does this code do what you want?

Code:
Sub Find_scr_StrikethroughIt()
    Dim SCR As Range
    With Columns("I")
      .Replace "scr", "=scr", xlWhole
      Set SCR = .SpecialCells(xlCellTypeFormulas)
      .Replace "=", "", xlPart
    End With
    SCR.Font.Strikethrough = True
    SCR.EntireRow.Select
End Sub
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
thank you.
Strikethrough worked only on 'scr' (column I)
The entire rows with scr are selected.

Is there an extra command that would strikethrough all the selected rows?
Is it ..
SCR.EntireRow.Font.Strikethrough
?
 
Upvote 0
thank you.
Strikethrough worked only on 'scr' (column I)
The entire rows with scr are selected.

Is there an extra command that would strikethrough all the selected rows?
Is it ..
SCR.EntireRow.Font.Strikethrough
?

Hmm, I posted the wrong code (it was what was in my Clipboard... I had forgotten to replace it with the latest code). Try this...

Code:
Sub Find_scr_StrikethroughIt()
    Dim SCR As Range
    With Columns("I")
      .Replace "scr", "=scr", xlWhole
      Set SCR = .SpecialCells(xlCellTypeFormulas)
      .Replace "=", "", xlPart
    End With
    SCR.EntireRow.Font.Strikethrough = True
End Sub
The above code does the strikethrough without selecting anything. If you still want to select the rows as well, add this line of code to the end...

Code:
    SCR.EntireRow.Select
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

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