Finding an occurence

D

Darin Kramer

Hi There,
Two columns of Data
A1 to A10 text (say dog, cat, mouse etc)
B1 to B10 - either a 1 or a 0 - 1 is a problem, 0 is okay. (these change
based on other criteria)

I would like to list beneath the data all instances of problems (ie for
all cases where column B has a zero, list the value in column A). Not
sure if combination of Match or Index would do it, but Im struggling!

Any ideas most welcome....

Regards

D


*** Sent via Developersdex http://www.developersdex.com ***
 
M

merjet

If you add headers, a Filter (menu Data | Filter) will do it. Choose
Advanced Filter if you want to put the results elsewhere.

Hth,
Merjet
 
M

merjet

Try this.

Sub macro1()
Sheets("Sheet1").Range("A13:B22").Clear
iRow = 13
For Each c In Sheets("Sheet1").Range("B1:B10")
If c = 1 Then
Sheets("Sheet1").Range("A" & iRow) = c.Offset(0, -1)
Sheets("Sheet1").Range("B" & iRow) = c
iRow = iRow + 1
End If
Next c
End Sub

Hth,
Merjet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top