+ Reply to Thread
Results 1 to 5 of 5

Macro no longer works

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    Arlington, VA
    MS-Off Ver
    2010
    Posts
    10

    Macro no longer works

    Hi! So I created three macros to help with reporting for my company.

    One sorts a field, another deletes unwanted columns, and the third double checks columns for answers--I work for a telecom polling firm.

    It was working last week on my computer, and it still works on another computer at the office. However, I keep getting an error message when I try to run it.

    The message is "Compile Error: Expected Function or Variable". The code is below, and bolded where it breaks down.--selection.Autofilter

    Please Login or Register  to view this content.
    What could be the rationale for the sudden breakdown? I was testing it on a file that I have tested with before without issue. I also tried a second file, and even restarted my computer. I am currently trying to write a fourth macro for counting responses and giving percentages, so while I don't need to have the perfectly cleaned data to do so it would be nice to have.

    And how do I fix it?

    Full disclaimer: I am relatively new to VBA and am still learning the basics so I apologize if the program is clunky.
    Last edited by alansidman; 07-30-2014 at 01:29 PM. Reason: code tags added for OP as new to forum

  2. #2
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: Macro no longer works

    put the text of your code into tab [CODE] by press # button on toolbar of "Quick Reply" because of the forum's rule, thanks
    Best regard, -)iger-/iger
    If you are pleased with a solution mark your post SOLVED.

  3. #3
    Registered User
    Join Date
    07-17-2014
    Location
    Arlington, VA
    MS-Off Ver
    2010
    Posts
    10

    Re: Macro no longer works

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,982

    Re: Macro no longer works

    Try changing these lines of code

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    07-17-2014
    Location
    Arlington, VA
    MS-Off Ver
    2010
    Posts
    10

    Re: Macro no longer works

    Fabulous! That worked, thanks a ton!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unmerge macro no longer works, needs some tweeking!
    By MZing81 in forum Excel General
    Replies: 0
    Last Post: 06-19-2012, 10:40 PM
  2. 'SendKeys' no longer works
    By aca in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-06-2010, 07:05 AM
  3. AgeFunc No Longer Works
    By jhrBanker in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-29-2009, 02:57 PM
  4. After formatting PC and reinstall Office macro no longer works.
    By oteixeira in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2008, 10:43 AM
  5. My formula no longer works?
    By DKerr in forum Excel General
    Replies: 1
    Last Post: 11-03-2006, 06:55 AM

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