New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Activate Macro(s) in excel 2010

Macros, VBA, Excel Automation, etc.

Activate Macro(s) in excel 2010

Postby lawitcher1 » Tue Dec 01, 2015 5:16 pm

I have imported a sheet from another file, and cannot get the macros to work. Please see attached, Prefixes sheet. Cell D2 should activate the prefix when the find prefix button is pressed. None of the buttons at the top of the page work, and I am too dumb to figure it out. Please help in a resolution of this matter.
  • 0

You do not have the required permissions to view the files attached to this post.
lawitcher1
Regular
 
Posts: 72
Joined: Jan 29, 2012
Reputation: 0

Re: Activate Macro(s) in excel 2010

Postby NoSparks » Tue Dec 01, 2015 7:26 pm

Is Excel not showing the same message as it did in your original inquiry regarding macros not working ?

The macros for the three buttons on the Prefixes sheet exist in a module of the originating workbook.
That module should be imported or those particular macros copied to a module in this workbook.
Hint: look at module 11.
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010

Re: Activate Macro(s) in excel 2010

Postby lawitcher1 » Tue Dec 01, 2015 9:52 pm

Well, I have done it now. I placed a password into the view code section to keep my grandson out, and I would like to erase the password, but the program will not let me. I cannot do anything until I get the password out and/or type in the password each time I want to work with the file. How do you delete the password????
  • 0

lawitcher1
Regular
 
Posts: 72
Joined: Jan 29, 2012
Reputation: 0

Re: Activate Macro(s) in excel 2010

Postby NoSparks » Tue Dec 01, 2015 10:24 pm

Alt+F11 to call up the Visual Basic Environment.
Enter your password to open the VBAProject.
Tools on the menu bar > VBA project properties.
Protection tab > uncheck Lock project for viewing > delete password.
Save the file.
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010

Re: Activate Macro(s) in excel 2010

Postby lawitcher1 » Wed Dec 02, 2015 3:19 am

I got the password removed, copied module 11 to the code on the sheet, but still am not able to access the buttons. Was I supposed to place the VBA code to a different location? Re[uploading file with change for your perusal.
  • 0

You do not have the required permissions to view the files attached to this post.
lawitcher1
Regular
 
Posts: 72
Joined: Jan 29, 2012
Reputation: 0

Re: Activate Macro(s) in excel 2010

Postby NoSparks » Wed Dec 02, 2015 11:03 am

You need to right click on each button and assign which macro the button is to run.
Before doing that have a read of this for a better understanding of where code should go. The code should have been copied to a standard code module rather than a sheets module.

The original .xls file, as downloaded, contains 22 standard modules, pretty much one for each procedure, and none were named to give any idea of what they contain. If this was my project, I'd copy each of the (needed) procedures into the same module and have only 1 module instead of 22.

You've eliminated about 15 buttons from the Station Log sheet and are using Hyperlinks instead of the original macros on the Band Plan sheet so I would think there's about the same number of modules that contain nothing you even need.

I hope this is a learning process and not just an exercise in frustration.
You're going to have numerous (minor) code issues to deal with.
  • 0

NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010

Re: Activate Macro(s) in excel 2010

Postby lawitcher1 » Wed Dec 02, 2015 11:37 am

Thank you. I was able to make and copy the module. I will take a look at the other modules and see if I can figure out what else I need. Is there anything that I need to do in order to copy any more code into the one and only module that I have? I have code written into the "Station Log" sheet (look at view code). Does that need to be moved to the module, and if so, where into the module?
  • 0

lawitcher1
Regular
 
Posts: 72
Joined: Jan 29, 2012
Reputation: 0

Re: Activate Macro(s) in excel 2010

Postby NoSparks » Wed Dec 02, 2015 12:13 pm

The sheet modules hold the code of built-in Excel Worksheet Events.
That code on the Station Log sheet module must be there in order to work.

edit: added this
Think I've reduced the macros to the minimum.
  • 0

You do not have the required permissions to view the files attached to this post.
NoSparks
Excel Hobbyist
 
Posts: 637
Joined: May 28, 2014
Reputation: 103
Excel Version: 2010


Return to Macros and VBA Questions

Who is online

Users browsing this forum: No registered users and 201 guests