简体   繁体   中英

create a button on worksheet to run vba code

Okay this question is going to show just how basic my knowledge is :(

My other question was answered perfectly and i now have a Code that runs moving a line of text to another workbook.

Currently I run this by pressing alt F11 and then the green play button. I have tried to add a button to the file so its easier for others and followed these instructions:

Go to the Developer tab in the ribbon. Select the Button Form Control from the menu. Right click and hold the mouse then drag and release to create your button. The Assign Macro window will pop up and you can select the VBA procedure you want to run from the button. Press the OK button.

It works to a degree, I can add the button and get the the assign macro pop up but then my VBA procedure is not showing - what am I doing wrong please? I think its something to do with naming the VBA maybe?

Simple way is going into the developer panel, click on Insert, button ActiveX then right click > Visualize Code and paste your code here

Tell me if it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM