Question about recording an excel macro

bthumble

Board Regular
Joined
Dec 18, 2007
Messages
239
Hello and thank you for reading my post.

Created a macro using the recorder so that I can format a cell quickly. This involves Fill color green, font white and white boarder around the cell. After creating it and assigning a button in the quick access toolbar it does not work. Error says it can't file the file and is it possible it was moved renamed or deleted. Any ideas to what I am doing wrong.

Thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Did you save the code in your Personal Macro Workbook?

If not, it is only in the workbook that you recorded it in, which means that code will not be available unless you have that particular file open.
 
Upvote 0
Ribbon buttons can only call functions - I presume that is true for QAT buttons as well. Try changing your Sub (which is what the recorder would create) to a Public Function. IIRC, recorder would create sub in a standard module, so that part (standard module) should be ok.

EDIT - good point about personal. I presumed the problem was in the same workbook as the macro was recorded in.
 
Upvote 0
I see that the QAT will run macros, so it's not the same as the Ribbon. However, the default choice is "all workbooks". Perhaps the current workbook was chosen instead of all. I tested and can call a sub (macro) in a standard module from other workbooks given that I used the all workbooks option. My guess is, that automatically puts the sub in personal workbook.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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