Macro to copy VBA code from Excel Sheet and Run

ankgar

New Member
Joined
May 24, 2015
Messages
2
Hi,

I have VBA code in Sheet3 column A of my excel file. I want to assign a button in sheet1 A1 to copy the vba code from sheet3 colum A and run the script.
I am not able to put the code to open VBA through macro.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Welcome to the forum.
It can be done, and Chip Pearson has a good article on it (see Programming In The VBA Editor), but I would try and find another way.
Code that modifies itself looks suspect to a lot of virus scanners which may block your file. You also need to leave the project unlocked and (I think) reduce security levels.
 
Upvote 0
Welcome to the forum.
It can be done, and Chip Pearson has a good article on it (see Programming In The VBA Editor), but I would try and find another way.
Code that modifies itself looks suspect to a lot of virus scanners which may block your file. You also need to leave the project unlocked and (I think) reduce security levels.

Thanks Teeroy.
I have stock data in Sheet "STOCK".
I need to create labels in set format for a range of stock items (say s.no. 9 to 15). The format of a stock data label is in Sheet "LABEL".
I have put a code in Sheet "macro" which prints the provided range of s.no. of stock labels.
But I need to copy this code every time in the module to print the labels. I thought that copying VBA code would be the right thing to do.
Please suggest. https://www.wetransfer.com/downloads/c4c97ad9edcd3ab8b168a155d8ca7e4e20150529061841/22bf2bec1166ff006468e67fbbd82e2120150529061841/3289b6
 
Upvote 0

Forum statistics

Threads
1,207,423
Messages
6,078,443
Members
446,339
Latest member
keogata

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