import out of stock item to another sheet

rapitorres

New Member
Joined
Oct 5, 2017
Messages
39
Office Version
  1. 2010
Platform
  1. Windows
Hi.

what i have here is a little inventory system and its working with barcode.
in the OUT sheet all out of stock is automatically marked red. im thinking is there a way that i can import all (0) or out of stock products
to a different sheet and automatically remove when Stocked, so that i can monitor all the OUT OF STOCK ITEMS

feel free to navigate to my simple inventory
btw due to large amount of data manual calculation is applied. please press F9 for calculation

 
This script does this:
1. Deletes all rows on sheet named Out Of stock below row(1) I assume row(1) is a header row.
Let me know if you want that modified or modify yourself see note in script.
2. Any row on sheet named "Out" with a zero in column G will be copied to sheet name "Out Of Stock"

VBA Code:
Sub Filter_Me_Please()
'Modified  3/12/2021  5:04:53 AM  EDT
Application.ScreenUpdating = False
Dim lastrow As Long
Dim lastrowa As Long
Dim c As Long
Dim s As Variant
c = 7
s = "0"
lastrow = Sheets("Out").Cells(Rows.Count, c).End(xlUp).Row
lastrowa = Sheets("Out Of Stock").Cells(Rows.Count, 1).End(xlUp).Row
Sheets("Out Of Stock").Rows(2).Resize(lastrowa).Delete 'modify 2 to 3 or 4 what ever you need

With Sheets("Out").Cells(1, c).Resize(lastrow)

    .AutoFilter 1, s
    counter = .Columns(c).SpecialCells(xlCellTypeVisible).Count
    If counter > 1 Then
        .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Out Of Stock").Cells(2, 1)
    Else
        MsgBox "No values found"
    End If
    .AutoFilter
End With
Application.ScreenUpdating = True
End Sub
Thanks alot! let me try this. ill let you know. :)
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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
Back
Top