Im looking for some help creating some complicated module filtering code. The sheet will eventually contain a huge amount of data, so each time a row gets filtered the G cell will equal "yes" (that way only unfiltered rows will get processed, and the code will only run if unfiltered rows are present). The user adds new rows to the bottom, and then this code should filter them in.
The code will organize the sheet EquipmentData in the following way:
1- Remove any duplicated rows (from row 3 on), where Columns A and B match, giving priority to keep rows where Column E is not equal to "Manual". If neither have "Manual" in Column E then the higher row gets priority to stay. In cases where A is blank (and B matches) then it should only filter out if column C also matches (the same method of prioritizing applies).
2- Then organize the rows (from 3 on) by Column A in ascending alphabetical order (there will be some cases where A is blank. These rows should end up all together at the top)
3- When a row has been filtered in, the G cell should equal "yes".
Below is the code I started with to check if any new records have been added to the sheet that need filtering, but the actual filtering part is over my head:
Sub EquipmentDataSheetFilter()
Dim LR As Long
Dim LRFiltered As Long
LR = Worksheets("EquipmentData").Cells.Range("A:F").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LRFiltered = Worksheets("EquipmentData").Cells(Rows.Count, "G").End(xlUp).Row
If Not LR = LRFiltered Then
End If
End Sub
NB This sheet does contain conditional formatting which I want to protect.
Thanks,
James
Bookmarks