Solved

Excel filter by strike though

Posted on 2016-11-25
8
26 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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now