+ Reply to Thread
Results 1 to 4 of 4

Unable to run macro - get an error message

  1. #1
    Registered User
    Join Date
    10-25-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2016
    Posts
    24

    Unable to run macro - get an error message

    Hello,
    I have added some VBA code to my excel file, but when I click on the command button, I get an error message that reads "Cannot run the macros 'VBA_Code2Find_Data.xlsm!SearchBox. The macro may not be available in this workbook or all macros may be disabled.
    I have turned on all macros with "Enable all macros", I have the vba code added into the file, but nothing works...
    I am trying to enable a search of information in the table below, using either the Name or Address. The final table will have about 4000 rows and can be searched using either option. Some words in Name are common, such as Hall, Park and can fetch over a 100 rows in results.
    I would appreciate help to fix this error.
    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Unable to run macro - get an error message

    You have the macro in the code module for the worksheet. Try putting it in a standard module.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: Unable to run macro - get an error message

    It's just as the error says, the macro cannot be found. Right click on the button and select "assign macro", then select the macro you want to assign to the button. Your search button may have the correct macro name, but it does not have to correct macro location.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Unable to run macro - get an error message

    You also have some lines of code which, if you transfer it to a Standard Module, will nit work.

    For example;

    Please Login or Register  to view this content.
    Pieces of Code like such may have to remain in the Sheet Module itself.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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. [SOLVED] Unable to Get userForm to Recognise code. With Error message regarding VLookup
    By Mark Dynes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-08-2017, 01:20 PM
  2. unable to resolve a #NUM! error message
    By Bill369 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2015, 07:12 PM
  3. Excel 2010 - Unable to Insert Column - Error message not helping
    By tplenert in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-25-2014, 05:36 AM
  4. error message - unable to save external link values
    By BitsofColour in forum Excel General
    Replies: 0
    Last Post: 10-04-2005, 03:05 PM
  5. Replies: 1
    Last Post: 02-07-2005, 05:06 PM
  6. Error message: Unable to record
    By Tim in forum Excel General
    Replies: 0
    Last Post: 01-26-2005, 03:25 PM

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