Auto filter? AutoRemove or AutoDelete.. Please Help

p9326

New Member
Joined
Aug 19, 2022
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
Help expert guys, I need your help please....

I have a sample excel sheet with list of In and out data. I don't know if I will an use auto filter or auto delete or base on your suggestion.
IN-OUT.jpg


Assuming that I press the Command Button, all I want to see are the remaining In items that not been out on my data sheet so I can easily identify / count the remaining Items.

Filordelete.jpg



please Help
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
@p9326 It looks to me as if you are needing to filter and or delete based on the item description that is part of your Item string ?

If so, if each item description is unique can you maybe use helper columns, similar to example below, to assist?
You can maybe then filter / delete based on TRUE / FALSE either manually or by code.

Book1.xlsx
ABCDEF
1In/Out By UserLocation/AreaItemsItemDelete
2IN-USER 1Room - 3TV-Set - 1 22/09/18 14:51:08TV-Set - 1TRUE
3OUT-USER 2Room - 4TV-Set - 1 22/09/19 06:51:08TV-Set - 1TRUE
4IN-USER 1Dining - 1TV-Set - 2 22/09/18 14:51:10TV-Set - 2TRUE
5IN-USER 1Living Room - 2TV-Set - 3 22/09/18 14:51:11TV-Set - 3FALSE
6OUT-USER 3Dining - 2TV-Set - 2 22/09/18 14:51:12TV-Set - 2TRUE
7IN-USER 4Master Room - 1Dining-Set - 2 22/09/18 14:51:13Dining-Set - 2FALSE
8  
9  
10  
Sheet2
Cell Formulas
RangeFormula
E2:E10E2=IFERROR(TRIM(LEFT(C2,LEN(C2)-17)),"")
F2:F10F2=IF(E2="","",ISEVEN(COUNTIF(E:E,E2)))
 
Upvote 0
@Snakehips Thank you for your suggestion, I have thousand of data, my excel sheet will hang instantly when I modify it with formula. I would like my out same with the picture below.

IN.jpg


I tried the code below, but only the Out items are removed and see the picture below

Sub RemoveDuplicaterow()

Dim Rng As Range
Dim x As Long
Set Rng = Range("C2", Range("C" & Rows.Count).End(xlUp))
x = Rng.Rows.Count

For x = x To 1 Step -1
With Rng.Cells(x, 1)
If WorksheetFunction.CountIf(Rng, .Value) >= 2 Then
.EntireRow.Delete
End If
End With
Next x

End Sub

Output.jpg
 
Upvote 0
Sorry for inconvenience, I found a solution on mine

Sub TotallyRemoveDuplicates()
Dim Addr As String
Addr = "C2:C" & Cells(Rows.Count, "C").End(xlUp).Row
Application.ScreenUpdating = False
Range(Addr) = Evaluate("IF(COUNTIF(C:C," & Addr & ")>1,""#N/A""," & Addr & ")")
On Error Resume Next
Columns("C").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
On Error GoTo 0
Application.ScreenUpdating = True
End Sub

Thanks Guys
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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