Loin75
Active Member
- Joined
- Oct 21, 2009
- Messages
- 281
Hi - the title is probably not very accurate, sorry.
I have a spreadsheet with the following:
Column A = Client Name
Column B = Postcode
Column C = Numerical Values
John Smith (for example) may be entered in many rows. Lets say he has 10 rows with respective data.
Column C should be numerical, but there are "?" entered for some values that we do not know.
My goal - If any one of John's rows has a ? entered into Column C, then I want to hide all of John's rows.
To make this slightly more complicated, we need to be able to match John Smith with his postcode to make sure we are not hiding rows belonging to a different John Smith. (we are talking 20000 rows of client data).
I have this code as my starter, but do not have the knowledge to include the correct search mechanism, if it is at all possible.
Many thanks for any help...
I have a spreadsheet with the following:
Column A = Client Name
Column B = Postcode
Column C = Numerical Values
John Smith (for example) may be entered in many rows. Lets say he has 10 rows with respective data.
Column C should be numerical, but there are "?" entered for some values that we do not know.
My goal - If any one of John's rows has a ? entered into Column C, then I want to hide all of John's rows.
To make this slightly more complicated, we need to be able to match John Smith with his postcode to make sure we are not hiding rows belonging to a different John Smith. (we are talking 20000 rows of client data).
I have this code as my starter, but do not have the knowledge to include the correct search mechanism, if it is at all possible.
Code:
Option Explicit
Dim c As Range, rng As Range
Sub Hide()
Set rng = Range("C2", Range("C10000").End(xlUp))
For Each c In rng
If c.Value = "?" Then
c.EntireRow.Hidden = True
End If
Next cel
End Sub
Many thanks for any help...