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.
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?
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.
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.
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.