Solved

Excel filter by strike though

Posted on 2016-11-25
8
46 Views
Last Modified: 2016-11-30
I have an Excel spreadsheet where certain rows have fields with the font has a strike though
Can I filter these in some way
Gordon
0
Comment
Question by:GiaHughes
  • 4
  • 3
8 Comments
 
LVL 25

Accepted Solution

by:
ProfessorJimJam earned 250 total points
ID: 41901415
you can do this with using a helper cell and UDF


i have created the attached workbook as example.  i put the code below and then see column A has data with some cells  strike though and then i used column B with UDF and then i filtered column B .
Function HasStrike(Rng As Range) As Boolean
HasStrike = Rng.Font.Strikethrough
End Function

Open in new window

Book1.xlsm
0
 
LVL 4

Assisted Solution

by:Elizabeth Anderson
Elizabeth Anderson earned 250 total points
ID: 41901432
Please try the code below -
Sub StrikeOut()
Dim cll As Range
Dim rng As Range
Dim rC As Integer

rC = Sheets("Sheet1").Range("A1").CurrentRegion.Rows.Count 'Gets the last row to check
Set rng = Sheets("Sheet1").Range("A1:A" & rC) ' Sets the range to search through
For Each cll In rng
    If cll.Font.Strikethrough = True Or cll.Offset(0, 1).Font.Strikethrough = True Then 
        cll.Font.Strikethrough = True
        cll.Offset(0, 1).Font.Strikethrough = True
    End If
Next cll
End Sub

Open in new window

0
 

Author Comment

by:GiaHughes
ID: 41901745
Hi
Where do I go in Excel to add these codes
Gordon
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 41901794
please download the attached i posted above

it already has the code in it.

if you press ALT+f11 you will see the code in a module.

for more detail on how to place the code on workbook see this link http://www.rondebruin.nl/win/code.htm
0
 

Author Comment

by:GiaHughes
ID: 41902068
OK have worked out how to input the code, have to select the developer option on the ribbin
Now, the column to use is B and not A, what do I change in the following

Sub StrikeOut()
Dim cll As Range
Dim rng As Range
Dim rC As Integer

rC = Sheets("Sheet1").Range("A1").CurrentRegion.Rows.Count 'Gets the last row to check
Set rng = Sheets("Sheet1").Range("A1:A" & rC) ' Sets the range to search through
For Each cll In rng
    If cll.Font.Strikethrough = True Or cll.Offset(0, 1).Font.Strikethrough = True Then
        cll.Font.Strikethrough = True
        cll.Offset(0, 1).Font.Strikethrough = True
    End If
Next cll
End Sub
0
 
LVL 25

Expert Comment

by:ProfessorJimJam
ID: 41902122
Please see the attachment on my post , the code you are referring is not mine.
0
 

Author Comment

by:GiaHughes
ID: 41907691
I have read the posts and not sure how to action the codes, so I am sure both solution work, but I don't know how to deal with theses
So closing question
0
 

Author Closing Comment

by:GiaHughes
ID: 41907692
Sorry guys
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question