Rename Macro Caption

aaronz07

New Member
Joined
Feb 13, 2007
Messages
25
Hi,

Please help with the below:

I need to create a macro in VBA that will need to rename the caption

eg. commandbutton1.caption = commanbutton2.caption

My problem is that how do I retain the caption change. I when I close the workbook I want the caption to stay the same. The buttons is on the form.

Thanks.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi Aaron,

You will have to save that text somewhere. Where depends on whether or not the workbook will be saved and what your preferences are.

If it will be saved:

In a cell (possibly hidden: row, column, worksheet)
In custom properties
Write to a text file
Write to the registry (machine specific)
(possibly other options)

If it will not be saved:

Write to a text file
Write to the registry (machine specific)

In any case, the saving of the text string could be done in the workbook "Close" event if not as soon as the caption changes.

Gary
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,472
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