Macro Help - Filtering outstanding equipment

ConnorTheScot

New Member
Joined
Mar 11, 2013
Messages
28
Good afternoon all,

I am looking for some assistance with a worksheet i am adapting for work.

What i have currently is a Macro which when pressed, filters out any blanks and returned equipment from column V (The filter drop down is in V5).

Sub GenerateJobDetailsReport()'
' GenerateJobDetailsReport Macro

ActiveSheet.Range("$A$5:$V$718").AutoFilter Field:=3, Criteria1:="<>"
ActiveWindow.SmallScroll ToRight:=4
Range("V5").Select
ActiveSheet.Range("$A$5:$V$718").AutoFilter Field:=22, Criteria1:= _
"Outstanding"
End Sub

Now there is an adaption being put in so that this column will now show the quantity of equipment outstanding. For example if 4 items were sent and 2 returned, the column will show "2 Outstanding" through use of a formula. What i require is for the GenerateJobDetailsReport macro to filter out all the blanks and returns and only show the rows which has a quantity outstanding.

Any suggestions are appreciated
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

pbornemeier

Well-known Member
Joined
May 24, 2005
Messages
3,896
This will display rows where column C is not empty and where column V contains the word "Outstanding". I do not understand the need for the column 3 portion of the filter since if that field is cleared it will hide any outstanding equipments for that row.

Code:
Sub GenerateJobDetailsReport() '
    'GenerateJobDetailsReport Macro
    
    Dim lLastDataRow As Long
    
    ActiveSheet.AutoFilterMode = False                       'Ensure nothing is filtered
    lLastDataRow = Cells(Rows.Count, 1).End(xlUp).Row        'Find last populated row in column A
    ActiveSheet.Range("$A$5:$V$" & lLastDataRow).AutoFilter _
        Field:=3, Criteria1:="<>"
    'ActiveWindow.SmallScroll ToRight:=4                     'Not needed for portion of code shown
    'Range("V5").Select                                      'Not needed for portion of code shown
    ActiveSheet.Range("$A$5:$V$" & lLastDataRow).AutoFilter _
        Field:=22, Criteria1:="=*Outstanding*", Operator:=xlAnd
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,511
Messages
5,832,175
Members
430,114
Latest member
kefier

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top