Macro not running

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
The objective is to double click on a button and then it takes me to another sheet. If I double click on the button nothing happens, but if I run it it runs perfectly.
 
Upvote 0
Benvenuto al foro.

You single-click a command button, not double-click.

1) Is the macro assigned to the button?

2) Is there a hatched grey frame around the button? If so, you are in design mode. Click out of the button so that the frame disappears, then click the button.

3) Place a checkpoint at the beginning of the macro and click the button: does execution pass to the macro?
 
Upvote 0
Yes it is a single click.

1) Is the macro assigned to the button? YES

2) Is there a hatched grey frame around the button? If so, you are in design mode. Click out of the button so that the frame disappears, then click the button. NO

3) Place a checkpoint at the beginning of the macro and click the button: does execution pass to the macro? Doesn't understand what you mean about a check point.
 
Upvote 0
Is the button from the Form Controls or the ActiveX Controls?

What version of Excel are you using?

Any chance we could see the code?
 
Upvote 0
Doesn't understand what you mean about a check point.
Sorry, I meant 'breakpoint'.

Switch to your VBA code window and find a statement somewhere at the start of your program - the Sub line will do. Click in the grey bar to the left of the statement and a maroon dot will appear: this indicates that the breakpoint is set. (You can't set breakpoints against non-executable statements like DIMs, comments or labels.)

Now go back and click your command button. If the button successfully passes control to the macro, execution will stop at the breakpoint and the line of code will be highlighted: in this case your problem is in your macro. As Peter suggests, post your code.

If execution doesn't stop at the breakpoint, then the button has not passed control to the macro. In this case your button is not calling the macro: it may not be assigned or you may be in design mode.
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top