Help!! - From Brazil

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Prezados Colegas..

Coluna A Coluna B
Item A 10
Item B 40
Item C 18
Item D 0
Item E 20
Item F 0
Item G 0

Gostaria sem utilizar VBA que ficassem assim

Coluna A Coluna B
Item A 10
Item B 40
Item C 18
Item E 20

Ou seja, que através de um comando, eu apresentasse as células somente com
valores superiores a "0".
 
If you desire to delete rows in which the value of the cell in column B is
zero then:

Sub delete_some_rows()

Dim r As Range, j As Long


Set r = ActiveSheet.UsedRange
j = r.Rows.Count + r.Row
Set rdel = Cells(j, "A")
For i = 1 To j - 1
If Cells(i, "B").Value = 0 Then
Set rdel = Union(rdel, Cells(i, "A"))
End If
Next


rdel.EntireRow.Delete


End Sub

If you desire something else, then ignore this reply.
 
Public Sub ProcessData()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To iLastRow
If Cells(i,"A").Value = 0 Then
Rows(i).Delete
End If
Next i

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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