+ Reply to Thread
Results 1 to 4 of 4

Compile Error: Sub or Function not defined

  1. #1
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Compile Error: Sub or Function not defined

    Hey all,

    I have a macro that filters out data using auto filter. Problem is once everything is complete, I only want to keep the visible cells and destroy everything else. So I added a For Each In loopm to iterate through active cells and set their auto filter mode to false, which hopefully removes any filtering. Unfortunately it gives me a compire error highlighting the text "specialCell":
    Please Login or Register  to view this content.
    Thanks for any response.

  2. #2
    Registered User
    Join Date
    09-18-2010
    Location
    Kalamazoo, MI
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Compile Error: Sub or Function not defined

    Why don't you use something like the following? ActiveSheet.AutoFilterMode = False

    Also, if you are trying to just keep the filtered data, why don't you copy visible cells after the filter and then paste it into a new sheet and delete the old one?

  3. #3
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Re: Compile Error: Sub or Function not defined

    Because I'm trying to put it all together in a macro. And if I copy and paste to new document, then it won't work with macro.

  4. #4
    Registered User
    Join Date
    09-18-2010
    Location
    Kalamazoo, MI
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Compile Error: Sub or Function not defined

    I don't mean a new document, just add a new Sheet (tab) in your workbook and paste your values in there.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1