I am creating an Excel spreadsheet for inventory management. Every month I will be changing the quantities on-hand and that need to be ordered. I'm writing the macro, and I can only get it to "select" the quantities that exist on the current sheet. In order to get it work properly during the next inventory cycle, I need it to refresh all data, and then apply a filter across 3 different sheets that will Deselect items that have the quantity "0". Currently, the macro will only select what items are currently in the filter as opposed to deselecting the unwanted quantities.
The current macro looks like:
Sheets("Functional Inventory").Select
ActiveWorkbook.RefreshAll
Sheets("Atlantic Medical Order Sheet").Select
ActiveSheet.Range("$A$3:$C$21").AutoFilter Field:=2, Criteria1:=Array("1"), Operator:=xlFilterValues
Sheets("BG Order Sheet").Select
ActiveSheet.Range("$A$4:$D$212").AutoFilter Field:=2, Criteria1:=Array("1", _
"2", "30", "4", "5", "60"), Operator:=xlFilterValues
Sheets("Choice Order Form").Select
ActiveSheet.Range("$A$5:$C$12").AutoFilter Field:=2, Criteria1:="1"
Sheets("Atlantic Medical Order Sheet").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("BG Order Sheet").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("Choice Order Form").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=FalseAny
help would be greatly appreciated!
I enclosed a picture of one of the workbooks that I am trying to improve. Example Order Form
So basically, the quantity to be ordered is populated by a number from another workbook. Each month, we perform inventory duties, so the quantity to be ordered for each item will range from 0 to infinity. I just want the macro to use the filter to deselect the items that have a quantity "0" to be ordered, therefore the order sheet will only display the items that need to be ordered in non-zero quantities.
My current problem is that when I record the macro, I deselect "0", but the macro recorder is selecting all of the example quantities that I have entered instead of deselecting 0. For example, "Criteria1="1" when the only items to be ordered have "1" entered in the quantity to be ordered, or Criteria1:=Array("1","2","30"...etc) when my test quantities for items to be ordered are 1,2,30, etc. I would like the logic to be something like Criteria1= (not 0), so any non-zero quantity from 1 to a million will be selected. The problem with selecting the available quantities that exist today, is that next month, the quantity to be ordered may be different, and with the logic that the macro is using, the new quantities will not be selected. However, I cannot figure out how to perform this simple task. Any help would be appreciated!