• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hiding Specific Sort Results

Piercev3

New Member
This is what I am trying to do,


I had to reference information from sheet A to sheet B in the same workbook. After I referenced the code, description and quantitfy from sheet A to sheet B, I needed to sort from highest quantity to lowest quantity. Ok,is there a way to filter out results where the quantity is 0?


Thank you!
 
Probably.


What formulas are you currently using? Can you just add an AutoFilter to sheet B to filter out the zeros? Is the sorting done manually, or is that part of your formula/macro?
 
The sorting is done using a macro button that sorts the columns based on quantity from largest to smallest.
 
You could add a bit into your macro then to delete the 0 qty rows. Something like this:

[pre]
Code:
Sub DeleteZeros()
Dim QtyCol As String
Dim LastRow As Integer

'You need to define this
QtyCol = "D"
LastRow = Cells(65536, QtyCol).End(xlUp).Row
Application.ScreenUpdating = False
For i = LastRow To 2 Step -1
With Cells(i, QtyCol)
If .Value = 0 Then
.EntireRow.Delete
End If
End With
Next i
Application.ScreenUpdating = True
End Sub
[/pre]
 
Back
Top