autofilter

  1. 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 -...
  2. 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 =...
  3. A

    Autofilter for multiple sheets which may/may not have the data

    Hi all Ive been having some errors with this part of my code in bold. as i have this code run for 4 different sheets, each sheet will come back with different data, some sheets even with no data. this code works fine on 1 sheet, and the rest keeps getting stuck at the bolded part even though...
  4. J

    Autofilter / Advanced Filter Copying over all data

    Hi, This is a bit frustrating. I've applied code to filter data using the autoFilter function but when I apply a new line with AdvancedFilter it appears it clears the filtered range and copies over all data With Sheets(1).ListObjects("Table13256").Range.AutoFilter Field:=22, Criteria1:="<>"...
  5. H

    On Error Resume Next - cover all autofilter criteria

    Hi All Just a quick one - can I check the error handler covers all my autofilter criteria? I can't avoid the errors occurring on any of the criteria, I just want to skip over. Sub DataRaw() Sheets("DataInput").Select On Error Resume Next Selection.AutoFilter...
  6. M

    Deleting specific rows with VBA

    Hi Guys I have data in two columns and would like to delete data in the second column which has the letter 'N' in it, using the auto filter. The amount of rows will vary. In the example below, there are only 5 rows and I would like to delete rows 3 and 4, as they're the rows with the letter...
  7. P

    Autofilter

    <code>Hi gang - I need some help.....I'm doing an autofilter and want I want is that if the filter doesn't come up with any results, then I want to unfilter. If it does come up with a result, I want to copy the data in column H onto a different sheet. What currently happens with my below code...
  8. D

    using resize ?

    I have the following code which sets a range based on data being in the last column, however after running the autofilter a few lines later, the rows meeting the criteria have no data in the last column and are not copied to the new sheet. How could i get all the records after the autofilter...
  9. J

    macro to delete all visible rows in an autofilter

    Hi, I have an autofilter on row 13 and then trying to delete all the visible rows I found somewhere that the below code should work, but it doesn't. Anyone who could help me crack the code? Thanks, Jos Rows("13:13").AutoFilter Field:=5, Criteria1:="22 - Rabobank 370113144" .Offset(1...
  10. J

    AutoFilter

    how can i change the code below to activesheet instead of referencing sheet name so i can use in other sheets and don't have to change sheet name everytime. Sub ApplyFiters_Accrued()With Worksheets("OCT").Range("A3") .AutoFilter Field:=5, Criteria1:="" .AutoFilter Field:=9, Criteria1:="COGS"...
  11. D

    How to use Macros to Filter less than or equal to Cell Values

    Hello, I want this Macro to filter off less than or equal to, not just equal to. Also, if one of the cells is blank (B2 or C2) I would like it to show 'all' for that selection, rather than 'none.' Can anybody help me? Private Sub Worksheet_Change(ByVal Target As Range) Set Target =...
  12. K

    VBA Autofilter to exclude text from list

    Hi All Just wondering if the below code can be modified to exclude certain text from a filtered list as opposed to having to list all the text that you do want selected? Current code which will select C: ActiveSheet.Range("$A$1:$AA$11").AutoFilter Field:=3, Criteria1:="C" Cheers, KiwiDD
  13. S

    userInterfaceOnly leaves cells unlocked

    Hi, I'm trying to leave certain cells/functions open for user input, but keep running into a problem I can't figure out. I've been through endless forum threads, but none has been able to help me so far... I have a workbook with 4 sheets, two of which are VeryHidden and not relevant. The third...
  14. M

    Autofilter omitting some columns and I can't work out why

    There are headers in the top row for all columns. There are no gaps between columns. Columns A, B and C are frozen. I put autofilter on and it's fine. Then sometimes after I have been merrily using the spreadsheet for a while I notice that columns A and B are not in the filter. This is...
  15. StuLux

    VBA Autofilter for 3 or more criteria

    I've read several posts about how to use autofilter with more than 2 criteria and the answer seems to be to use an array - I am trying the following but get a Type Mismatch error on the Criteria 2 line? Criteria1 = "*Meeting 1*" Criteria2 = Array("<>*at their Stand*", "<>*Table...
  16. E

    Is it impossible to AutoFilter based on a range of values?

    Need to AutoFilter based on a range of values, such as: Worksheets("Sheet2").Range("A1:A5").Value When the range code is inserted into the rest of the VBA code, such as: Worksheets("Sheet1").Range("$A$5:$C$100").AutoFilterField:=2, Criteria1:=Worksheets("Sheet2").Range("A1:A5").Value The code...
  17. C

    Autofilter with 2+ cell references with "or" and "contains"

    Hi there, I'm a long time listener (reader) first time caller (writer). I have scanned through dozens of forums and topics but can't seem to find a working solution for this challenge: I have a table with multiple rows where I'm trying to autofilter a specific column based on 2+ inputs in...
  18. A

    autofilter table AND adjacent data

    Is it possible to autofilter a data table and the adjacent data using the one filter? I'm after a similar result to inserting a column before a pivot table and autofiltering that column, which then applies the filter to all used columns, including adjacent data.
  19. H

    AutoFilter Copy/Paste

    I'm trying to copy the results of an autofilter, with the code below but keep getting a run-time error '1004': Unable to get the SpecialCells property of the Range class. How do i fix that? thanks! Dim LR As Long Dim rng As Range With Sheet1 AutoFilterMode = False LR =...
  20. J

    VBA autofilter field using dynamic range

    Hello all, If I have the following line of VBA, can I make the "AutoFilter Field:=7" number dynamic? ActiveSheet.Range("Data_column_headers").AutoFilter Field:=7, Criteria1:="=" Ideally I would place my named range in there as my columns move around. Thanks!

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top