Sub Test()
Dim rCells As Range, i As Long
For Each rCells In Range("A1:A50") '<-- Adjust to suit
If InStr(LCase(rCells.Value), "scr") <> 0 Then
With rCells
.Font.Strikethrough = True
.Interior.ColorIndex = 3
End With
End If
Next rCells
End Sub
Sub Find_scr_StrikethroughIt()
Application.ReplaceFormat.Font.Strikethrough = True
Application.ReplaceFormat.Interior.ColorIndex = 3
Columns("A").Cells.Replace "scr", "scr", xlWhole, , False, , False, True
End Sub
You will need to do the following for each workbook (if that is what you meant by "vba projects") that you want to have this functionality. From any worksheet, press ALT+F11 to go into the VB editor. Once there, click Insert/Module on its menu bar. This will open up a code window... copy/paste whichever code procedure you choose to use (I'd suggest using mine as it will execute faster) into that code window. Now go back to your worksheet with the data on it and press ALT+F8 to bring up the macro dialog box. Find the macro name in the list and click the Run button.I'm afraid my VBA progression has come to a grinding halt.
I have 5 vba projects.
Where exactly do i paste the above code
and how do i run it?
What column (or columns) is the data that can contain "scr" in?Nothing happens.
The excel page is unchanged.
Rick's code - nothing happens
when i run Biz's code, it results in a runtime 13 error.
Any ideas?
Well that is the first problem. You never told us the data is in Column I (you actually did not tell us where it was)... both Biz and I assumed it was in Column A.The 'scr' is only in the i column
I am guessing that means Column I contains constants only.there only 1 functions applying to one other column.
Sub Find_scr_StrikethroughIt()
Application.ReplaceFormat.Font.Strikethrough = True
Application.ReplaceFormat.Interior.ColorIndex = 3
Columns("I").Cells.Replace "scr", "scr", xlWhole, , False, , False, True
End Sub