Hide row based on cell value

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
Dear All

I know that there are many requests for this but nothing seems to cover my need.

I would like to select a range of rows and hide only those that contain a % character with a space either side within the text in column A. It would also be helpful if the reverse could be available to only show those that do not contain a % character.

As ever all help is most appreciated.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hello,

I would apply a filter to the entire column or at least to a part of a column, You want to analyze. Then apply a filter called "contains..." and as a character fill "%". I tried this and the result was that all cells with "%" character in any combinations have been shown.

I hope this helps
 
Upvote 0
Something along the lines of

Dim c As Range, rng

Dim LASTROW As Long

LASTROW = Cells(Rows.Count, 1).End(xlUp).Row

Set rng = Range("a1:a" & LASTROW)
For Each c In rng
If InStr(c, " % ") Then
c.EntireRow.Hidden = True
End If
Next c
 
Upvote 0
mkaniewski

Thank you for your response.

I did try that but my problem is that it is not for a complete column just specific ranges and the top few rows are blank in columns A-C.
 
Upvote 0
Steve

Thank you for your response which works fine but as I have reason to only do this over differing ranges could it be adjusted to work on a range that is selected by me rather than the whole column.

Assuming that this can be done. could you also please add a version that opens up any hidden rows within the range and then shows only the rows that do have the % sign in column A.

I hope that this makes sense and again my thanks for taking the time with my problem
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

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