#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Help!! - From Brazil


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".
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Help!! - From Brazil

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.
--
Gary's Student


"Gerald" wrote:


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".

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Help!! - From Brazil

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)

"Gerald" wrote in message
...

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".



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid phil2006 Excel Discussion (Misc queries) 2 June 19th 06 12:27 PM
Advanced Filter Dee Excel Discussion (Misc queries) 3 January 25th 06 07:00 PM


All times are GMT +1. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"