extract non zero valus from a list.

  • Thread starter Thread starter TUNGANA KURMA RAJU
  • Start date Start date
T

TUNGANA KURMA RAJU

I am looking for a funtion that retrives names from col (a:a) whose
corresponding values in Col(b:b) are not zero or blank.Please don't suggest
filtering,or sorting.
 
I am looking for a funtion that retrives names from col (a:a) whose
corresponding values in Col(b:b) are not zero or blank.Please don't suggest
filtering,or sorting.

Not sure where you want to retrieve them to, so I wrote this code to
retrieve them to the immediate window, you can edit the code to fit
your needs. Or reply back and I can help make the adjustment.

Sub test()
Dim cell As Range
For Each cell In Range("A:A")
If cell <> "" And cell.Offset(0, 1).Value <> 0 Then
Debug.Print cell
Next cell
End Sub
 
Retieve the names in col C:c

GTVT06 said:
Not sure where you want to retrieve them to, so I wrote this code to
retrieve them to the immediate window, you can edit the code to fit
your needs. Or reply back and I can help make the adjustment.

Sub test()
Dim cell As Range
For Each cell In Range("A:A")
If cell <> "" And cell.Offset(0, 1).Value <> 0 Then
Debug.Print cell
Next cell
End Sub
 
very long back, I came across Row,Rows function to get this results,I need a
function.
 
This will retrieve name from column C

Sub test()
Dim cell As Range
For Each cell In Range("A:A")
If cell <> "" And cell.Offset(0, 1).Value <> 0 Then
Debug.Print cell.Offset(0, 1).Value
Next cell
End Sub
 

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

Back
Top