I am trying to extract all expired chemicals from the Inventory Closet, Refrigerator tab, Hood 1 tab, Hood 2 tab, Hood 3 tab, and Hood 4 tab into the ExpiredChemicals tab starting at A5 by combining them. Same format and everything.
I am trying to extract all expired chemicals from the Inventory Closet, Refrigerator tab, Hood 1 tab, Hood 2 tab, Hood 3 tab, and Hood 4 tab into the ExpiredChemicals tab starting at A5 by combining them. Same format and everything.
Maybe:
![]()
Sub gdclyde() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Select Case ws.Name Case Is = "Inventory Closet", "Refrigerator", "Hood 1", "Hood 2", "Hood 3", "Hood 4" ws.UsedRange.Offset(5).Copy Sheets("ExpiredChemicals").Range("B" & Rows.Count).End(3)(2) End Select Next ws With Sheets("ExpiredChemicals") .Range("H5:H" & Range("H" & Rows.Count).End(3).row).AutoFilter 1, "<>EXPIRED" .Range("H6:H" & Range("H" & Rows.Count).End(3).row).SpecialCells(12).EntireRow.Delete .AutoFilterMode = False End With End Sub
Is there a way where the list can have no spaces and it only lists the expired ones.
Not sure what you mean. When I run it there are only the ones indicated as "Expired" in Column H.
I made some changes by inserting columns to count my expired chemicals on each tab. I also made a change on the macro for the expired chemicals tab by deleting all the spaces between each tab when it load,so that the list is continous without no spaces. When I press the newly modified macro it copies everything. It copies over the hidden columns. So I see alot of zeros on the bottom the worksheet. Is there a way it only copies the expired chemicals without revealing the hidden columns.
Can you provide the code that you are using?
Chemical inventory.xlsxIts the same code. When I run the code its missing some chemicals that are expired. Its not transferring them into the expired chemicals tab.![]()
Sub expired() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Select Case ws.Name Case Is = "Inventory Closet", "Refrigerator", "Hood 1", "Hood 2", "Hood 3", "Hood 4" ws.UsedRange.Offset(4).Copy Sheets("ExpiredChemicals").Range("B" & Rows.Count).End(3)(2) End Select Next ws With Sheets("ExpiredChemicals") .Range("H4:H" & Range("H" & Rows.Count).End(3).Row).AutoFilter 1, "<>EXPIRED" .Range("H6:H" & Range("H" & Rows.Count).End(3).Row).SpecialCells(12).EntireRow.Delete .AutoFilterMode = False End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks