autofilter

  1. J

    VBA filtering array

    Hi All I'm looking to filter with the criteria being an array - can't quite get it to work. Simple example below - where am I going wrong? Thanks in advance! Jon Sub test() Dim Narrative As Variant Narrative = Array("*OPENING*", "*CLOSING*", "*VALUE*") Range("A2:H100").AutoFilter FIELD:=4...
  2. L

    Need to bring Cell value into autofilter VBA

    Hello Everyone, I have the following code currently: ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=33, Criteria1:= _ "<7/1/2020" ActiveSheet.ListObjects("Table4").Range.AutoFilter Field:=35, Criteria1:= _ "<1/01/1900"...
  3. U

    If criteria1 does not exist then...

    Hi all, This is a pretty common question but I can't seem to find a solution that works for me. I have the following code that is supposed to apply autofilter but if the criteria does not exist, I want it to turn off the filter and end if. However, the line If currentBoxRange.Offset(-1...
  4. H

    Autofilter More Than 2 Items

    I have a VBA macro which does a number of things, but I have not been able to get it to autofilter for more than 2 things, but I need it to do 4 Here is the macro Sub Low_Risk_Lays() ' ' Low Risk Lays Macro ' This macro will filter for Remove VDW Rank 1, Class, Distance <=1650, # of Runners...
  5. J

    VBA - filtering columns after inserting or deleting cells

    Good afternoon I'm looking for a way to make the field of an autofilter dynamic - for example: Range("a1:J" & LRow ).autofilter Field:=7, Criteria1:="" If someone were to add a column between B&C, the field would now need to be 8, but the code won't register this. I've thought about maybe...
  6. T

    Filter loop through macro

    I have various workbooks that I need to check the data in by filtering on various columns to find those that need to be checked and then I filter through the resultant list using usually column 'C', checking line by line and marking those 'done'. What I'd like to achieve is a button that...
  7. MikeMcCollister

    AdvancedFilter in VBA, Help!

    I am trying to do some advanced filtering so that I can sum some columns. My test code does not work. First when I try to set the criteria cell VBA just errors out. If I skip that and try to Call rangeTable.AdvancedFilter it does nothing. Function FilterTest(theMonth As String, category As...
  8. M

    VBA code to auto filter using cell reference

    Hi, I need a VBA code to autofilter list of values reference from a different sheet. The filter condition is such it should contain the values in the referenced cells not equal to the value in the cell The code I have been trying is as below Worksheets("ZBA extract").select...
  9. H

    Autofilter for Top Item

    Hi I know with autofilter it is possible to filter for top or bottom 10, but can't see any way to filter for the best item in a list. I have a sheet with maybe 150k rows and the data is grouped into dates, times and names and many columns with numbers relating to particular information. I'd...
  10. P

    Range.Insert not working when filter is active

    I haven't noticed this issue in regular Excel because I have an active filter, I can still right-click and insert a new table column. However, periodically, when I try to insert a new column in VBA, I run into a run-time 438 error when I have an active filter. Has anyone else experienced this...
  11. A

    macro, filter criteria2 = array for date column

    a macro reads the filtering selected by the user of an excel data file. When the user selects from a date column, using the tree list to select years, I can record a macro that simulates what has been selected as: ActiveSheet.Range("$A$3:$T$179896").AutoFilter Field:=4, Operator:= _...
  12. M

    Simple VBA Amendment

    Hello all, A really simple one for you folk I'm sure. I've got some existing code which I need to adapt ever so slightly. 1) The code currently runs on all sheets except 'Summary', but I need it to run on all sheets except 'Summary' and 'FAQs' 2) The other tabs have an autofilter on row 4...
  13. R

    VBA Autofilter Error Handling

    Hi everyone, I have a part of my code where I delete some rows based on information found with autofilters. On the first filter, when it does not meet the conditions, the code just skips it as it should. On the second filter, the error handling is not working. blankcolumn = Cells(1...
  14. B

    Create Custom Msgbox VBA Multiple Criteria

    Hi Everyone, What if I want multiple msgboxs per each sheet? I realize I can have two different outcomes to a specific scenario. Is there a way to use IF, THEN? For instance, if COLUMN L and COLUMN K equaled ONE then I would want a message to say "Burris article, check sourcing", but if COLUMN...
  15. dreen

    How to Autofilter on the second row

    I have 3 sheets in my workbook, and my code checks if the Active Cell in Sheet 2 is blank or not, If Len(ActiveCell.Value) = 0 Then MsgBox "Blank Key in:" & ActiveCell.Address, vbCritical Exit Sub End If If it's not blank, then my code counts the number of times the Active Cell in Sheet 2...
  16. J

    Filter a range that the value of my cell number falls into

    Hi, I am working with 2 worksheet in the same workbook. Sheet1 has the values. Sheet 2 has the table of data with header. My goal is to read the values from sheet1 and then filter a specific column with that said value. I can get that far. The issue is my value in sheet1 is not an exact value...
  17. Mister_J

    Macro To Filter Column Based On What I Want To Remain Visible

    I’ve been looking into finding or creating a macro that can filter a column of categories that continuously grows. I always want to filter the same categories but when new ones are added I have to add the new ones to the list to be filtered out. So can I create a macro that will filter...
  18. dreen

    Inserting a Visible Autofiltered Row into Another Sheet (Excluding Header)

    I am trying to AutoFilter (in column A of SHEET 1) the Active Cell in SHEET 2. Then I have an IF Statement that counts the number of Visible Rows, and if it is more than 1 (to exclude the header) then I would like to insert a new row into SHEET 3 and cut and paste the values of the Auto filtered...
  19. C

    VBA to automatically reapply filter

    I have a table that pulls data from another range based on a dropdown from another worksheet. I have tried VBA's to clear the blank rows based on a cell value and can't seem to get them to work. (I think it's because of the formula in the cells -...
  20. D

    Range.Rows property with autofilter applied

    Hi MrExcel, I need your help. I have an autofilter applied to a range resulting in non-continuous set of rows visible (see snapshot). Assume I want to access the number of the first visible non-header row (which is number 7 in this case). When I run Dim rng As Range Set rng =...

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