Combine Columns with Filter - Existing Macro

  • Hello,


    I have this macro that will combine a column based on matching data in specified columns. However, the macro (below) misbehaves when the data has an auto filter on it. Is there a way to modify this macro so that it will recognize the filtered data?


    Thank you for your help!


  • Re: Combine Columns with Filter - Existing Macro


    Quickest way would be to clear the filter first like so:

    Code
    1. If Not ActiveSheet.AutoFilter Is Nothing Then
    2. ActiveSheet.AutoFilter.ShowAllData
    3. End If
  • Re: Combine Columns with Filter - Existing Macro


    The macro will combine the data in column F if column D, E and H matches. I need to be able to filter the data, then run the macro without it pulling any data from the hidden rows that aren't needed in the filter.

  • Re: Combine Columns with Filter - Existing Macro


    Not tested


    If this doesn't work, I need to see the file

  • Re: Combine Columns with Filter - Existing Macro


    It gave an error Run Time Error '7' Out of Memory on this line...


    Code
    1. ReDim a(1 To .Rows.Count, 1 To Columns.Count)
  • Re: Combine Columns with Filter - Existing Macro


    Hah, yes, I noticed that and added the period. Then it proceeded with an error (Object doesn't support this project or method) on this line.


    Code
    1. For Each r In .Columns(1).SpecialCells(12)
  • Re: Combine Columns with Filter - Existing Macro


    Of course...

  • Re: Combine Columns with Filter - Existing Macro


    It pastes data into range W:AO, nothing combined, just randomly pasted into fields. I'd love to add an attachment, but the expanse of data is too large to make a dummy copy of or to share the original.