Finding individual cells with strikethrough

sammendac

New Member
Joined
May 28, 2014
Messages
37
Hi

I have a spreadsheet that is produced by a Co-ordinate Measuring Machine. it is a simple 47 row by 11 cols with numbers in black in the cells. If the measurement is outside the tolerance of the part being measured, the result is a number but it is in red with strike-through.

I need to identify individual cells that have this format, and put a fault code in Col K on the row concerned. The range that this should operate on is C8 to J47. there are cells outside this range that have this format but they must be ignored.

The fault code varies with the columns so if a failure is in Col C it is fault code META, and in say Col E it is fault code HAZ1. I can do all this stuff but I can't identify an individual cell, all i can do is to identify if any cell in the complete range is struck through. This means that I have to manually allocate Fault codes.

A simple way to identify a cell within a range that has this format is what I am looking for.

Any help would be greatly appreciated.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hallo,

try this code:

Code:
Sub iFen()
Dim rng As Range
With Range("A1")
    .Font.Strikethrough = True
    .Value = "Hello World"
End With
Application.FindFormat.Font.Strikethrough = True
With Range("C8:J47")
Set rng = .Find("*", , , , , , , , True)
If Not rng Is Nothing Then
    St_Adr = rng.Address
    Do
        Set rng = .FindNext(rng)
        Debug.Print rng.Address '<<<<<<<<<<< here your code
    Loop Until rng.Address = St_Adr
End If
End With
End Sub

You have to add the code to highlight the column.

regards
 
Upvote 0
just tried it. the first part works adding struck through Hello World , then it hung because ST-Adr was not defined. Defined it then run programme and nothing happens. what I was thinking was a for next loop loooking at each individual cell and if it was struck through adding the fault code in another column row by row.
something like.
for x = 8 to 47
if cells(x,3) is struck through then
cells(x,L) = "failed"
next x

the bit in red is the problem
 
Upvote 0
Something like
Code:
For x = 8 To 47
If Range("C" & x).Font.Strikethrough = True Then Range("L" & x).Value = "failed"
Next x
 
Upvote 0

Forum statistics

Threads
1,215,372
Messages
6,124,532
Members
449,169
Latest member
mm424

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